mirror of
https://github.com/php/php-src.git
synced 2025-08-18 15:08:55 +02:00
Fix more crashes related to this switch to z_value
This commit is contained in:
parent
6d4e4e0cf5
commit
bf513871bc
1 changed files with 2 additions and 2 deletions
|
@ -132,7 +132,7 @@ PHP_FUNCTION(setcookie)
|
||||||
len += Z_STRLEN_PP(z_domain);
|
len += Z_STRLEN_PP(z_domain);
|
||||||
}
|
}
|
||||||
cookie = emalloc(len + 100);
|
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
|
* 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
|
* so in order to force cookies to be deleted, even on MSIE, we
|
||||||
|
@ -144,7 +144,7 @@ PHP_FUNCTION(setcookie)
|
||||||
efree(dt);
|
efree(dt);
|
||||||
} else {
|
} else {
|
||||||
/* FIXME: XXX: this is not binary data safe */
|
/* 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) {
|
if (expires > 0) {
|
||||||
strcat(cookie, "; expires=");
|
strcat(cookie, "; expires=");
|
||||||
dt = php_std_date(expires);
|
dt = php_std_date(expires);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue