From 4df77a6c5852a8ba0ccb1a10e01a49c71d1f54b5 Mon Sep 17 00:00:00 2001 From: Bob Weinand Date: Wed, 19 Aug 2015 01:33:19 +0200 Subject: [PATCH] Fixed bug #70295 (Segmentation fault with setrawcookie) --- NEWS | 3 +++ ext/standard/head.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 39c2f3665f..a495f10a34 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,9 @@ PHP NEWS - Core: . Fixed bug causing exception traces with anon classes to be truncated. (Bob) +- Standard: + . Fixed bug #70295 (Segmentation fault with setrawcookie). (Bob) + 20 Aug 2015, PHP 7.0.0 RC 1 - Core: diff --git a/ext/standard/head.c b/ext/standard/head.c index 5a53ae2d50..215089b8a1 100644 --- a/ext/standard/head.c +++ b/ext/standard/head.c @@ -141,7 +141,7 @@ PHPAPI int php_setcookie(zend_string *name, zend_string *value, time_t expires, if (!p || *(p + 5) != ' ') { zend_string_free(dt); efree(cookie); - zend_string_free(encoded_value); + zend_string_release(encoded_value); zend_error(E_WARNING, "Expiry date cannot have a year greater than 9999"); return FAILURE; } @@ -155,7 +155,7 @@ PHPAPI int php_setcookie(zend_string *name, zend_string *value, time_t expires, } if (encoded_value) { - zend_string_free(encoded_value); + zend_string_release(encoded_value); } if (path && ZSTR_LEN(path)) { -- 2.50.1