cvs: php4 /ext/standard head.c

From: Date: Sat, 21 Jul 2001 00:14:14 +0000
Subject: cvs: php4 /ext/standard head.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-6296@lists.php.net to get a copy of this message
rasmus Fri Jul 20 20:14:14 2001 EDT Modified files: /php4/ext/standard head.c Log: Fix more crashes related to this switch to z_value Index: php4/ext/standard/head.c diff -u php4/ext/standard/head.c:1.41 php4/ext/standard/head.c:1.42 --- php4/ext/standard/head.c:1.41 Thu Jun 14 11:36:10 2001 +++ php4/ext/standard/head.c Fri Jul 20 20:14:14 2001 @@ -15,7 +15,7 @@ | Authors: Rasmus Lerdorf <rasmus@lerdorf.on.ca> | +----------------------------------------------------------------------+ */ -/* $Id: head.c,v 1.41 2001/06/14 15:36:10 stas Exp $ */ +/* $Id: head.c,v 1.42 2001/07/21 00:14:14 rasmus Exp $ */ #include <stdio.h> #include "php.h" @@ -132,7 +132,7 @@ len += Z_STRLEN_PP(z_domain); } cookie = emalloc(len + 100); - if (!Z_STRVAL_PP(z_value) || !Z_STRVAL_PP(z_value)[0]) { + if (z_value && (!Z_STRVAL_PP(z_value) || (Z_STRVAL_PP(z_value) && !Z_STRVAL_PP(z_value)[0]))) { /* * MSIE doesn't delete a cookie when you set it to a null value * so in order to force cookies to be deleted, even on MSIE, we @@ -144,7 +144,7 @@ efree(dt); } else { /* FIXME: XXX: this is not binary data safe */ - sprintf(cookie, "Set-Cookie: %s=%s", Z_STRVAL_PP(z_name), Z_STRVAL_PP(z_value) ? encoded_value : ""); + sprintf(cookie, "Set-Cookie: %s=%s", Z_STRVAL_PP(z_name), (z_value && Z_STRVAL_PP(z_value)) ? encoded_value : ""); if (expires > 0) { strcat(cookie, "; expires="); dt = php_std_date(expires);

« previous php.cvs (#6296) next »