Return-Path: Delivered-To: apmail-httpd-apreq-dev-archive@httpd.apache.org Received: (qmail 29887 invoked by uid 500); 9 Oct 2002 21:42:34 -0000 Mailing-List: contact apreq-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list apreq-dev@httpd.apache.org Received: (qmail 29864 invoked from network); 9 Oct 2002 21:42:34 -0000 Subject: Re: BUG: Apache::Cookie doesn't handle 0 From: Joshua Moore-Oliva To: Michael McLagan Cc: apreq-dev@httpd.apache.org In-Reply-To: <200210092106.g99L64Qa014470@utility.invlogic.com> References: <200210092106.g99L64Qa014470@utility.invlogic.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.8 Date: 09 Oct 2002 17:40:01 -0400 Message-Id: <1034199602.18003.5.camel@CPE014470002100.cpe.net.cable.rogers.com> Mime-Version: 1.0 X-Authentication-Info: Submitted using SMTP AUTH PLAIN at fep02-mail.bloor.is.net.cable.rogers.com from [24.114.45.193] using ID at Wed, 9 Oct 2002 17:42:00 -0400 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N >From what I saw on the C interface, the cookie values are name//value STRING pairs... And since a 0 byte marks the end of a string in C, the value is cut off at the zero byte because it is the end of the string... In addition, (this part I am unsure of) but I believe that cookies are only supposed to hold printable characters anyways... Josh. On Wed, 2002-10-09 at 17:06, Michael McLagan wrote: > Hello, > > I posted this to mod_perl's list about a month ago and didn't see much > comment other than my being berated for being clueless so I thought I might > send it here to see if it generated a more positive result. > > -------- Original Message -------- > There is a bug in Apache::Cookie. It doesn't handle a cookie with a zero > byte in it! > > $value = "ABCD" . chr(0) . "EFGH"; > $cookie = Apache::Cookie->new($request, -name=> 'oatmeal', -value=> > $value, -domain=>$ENV{'SERVER_NAME'}, -path=>"/"); print > $cookie->as_string; > > The output looks like: > > oatmeal=ABCD; domain=my.web.server.com; path=/; expires=0 > > Where did the rest of my cookie go?! > > Should I not have gotten: > > oatmeal=ABCD%00EFGH; domain=my.web.server.com; path=/; expires=0 > > -------- Original Message -------- > > Please CC me on replies, I'm not on the list. > > Michael