1
0
mirror of https://github.com/php/php-src.git synced 2026-04-20 14:31:06 +02:00

Fix potential crash

This commit is contained in:
Stanislav Malyshev
2001-06-14 15:36:10 +00:00
parent f2ec3fa6e5
commit 5ad3d2828f

View File

@@ -157,11 +157,11 @@ PHP_FUNCTION(setcookie)
efree(encoded_value);
}
if (Z_STRVAL_PP(z_path) && Z_STRLEN_PP(z_path)>0) {
if (z_path && Z_STRVAL_PP(z_path) && Z_STRLEN_PP(z_path)>0) {
strcat(cookie, "; path=");
strcat(cookie, Z_STRVAL_PP(z_path));
}
if (Z_STRVAL_PP(z_domain) && Z_STRLEN_PP(z_domain)>0) {
if (z_domain && Z_STRVAL_PP(z_domain) && Z_STRLEN_PP(z_domain)>0) {
strcat(cookie, "; domain=");
strcat(cookie, Z_STRVAL_PP(z_domain));
}