Skip to content

Commit 4df77a6

Browse files
committed
Fixed bug #70295 (Segmentation fault with setrawcookie)
1 parent 32462a8 commit 4df77a6

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ PHP NEWS
55
- Core:
66
. Fixed bug causing exception traces with anon classes to be truncated. (Bob)
77

8+
- Standard:
9+
. Fixed bug #70295 (Segmentation fault with setrawcookie). (Bob)
10+
811
20 Aug 2015, PHP 7.0.0 RC 1
912

1013
- Core:

ext/standard/head.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ PHPAPI int php_setcookie(zend_string *name, zend_string *value, time_t expires,
141141
if (!p || *(p + 5) != ' ') {
142142
zend_string_free(dt);
143143
efree(cookie);
144-
zend_string_free(encoded_value);
144+
zend_string_release(encoded_value);
145145
zend_error(E_WARNING, "Expiry date cannot have a year greater than 9999");
146146
return FAILURE;
147147
}
@@ -155,7 +155,7 @@ PHPAPI int php_setcookie(zend_string *name, zend_string *value, time_t expires,
155155
}
156156

157157
if (encoded_value) {
158-
zend_string_free(encoded_value);
158+
zend_string_release(encoded_value);
159159
}
160160

161161
if (path && ZSTR_LEN(path)) {

0 commit comments

Comments
 (0)