httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Philip M. Gollucci" <pgollu...@p6m7g8.com>
Subject Re: parser-related sigsegv
Date Fri, 22 Apr 2005 03:07:28 GMT
Joe Schaefer wrote:
> Index: library/cookie.c
> ===================================================================
> --- library/cookie.c	(revision 161816)
> +++ library/cookie.c	(working copy)
> @@ -134,7 +134,7 @@
>  
>      c = apr_palloc(p, nlen + vlen + 1 + sizeof *c);
>  
> -    if (c == NULL || nlen == 0)
> +    if (c == NULL)
>          return NULL;
>  
>      *(const apreq_value_t **)&v = &c->v;
> @@ -144,7 +144,7 @@
>      v->data[vlen] = 0;
>      v->dlen = vlen;
>      v->name = v->data + vlen + 1;
> -    if (name != NULL)
> +    if (nlen && name != NULL)
>          memcpy (v->name, name, nlen);
>      v->name[nlen] = 0;
>      v->nlen = nlen;
> 
+1

Wow Thanks!.  I doubled checked param.c and the 2nd if
does already contain the 'if (nlen'

Question, can you set a cookie without a name ? Thought to be safe this 
is better.



-- 
END
------------------------------------------------------
Philip M. Gollucci (pgollucci@p6m7g8.com) 301.254.5198
Consultant / http://p6m7g8.net/Resume/resume.shtml
Senior Developer / Liquidity Services, Inc.
	http://www.liquidityservicesinc.com

Mime
View raw message