From 98c625a31cc329aa45c48d9c376c6197e278a3a5 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Thu, 10 Mar 2016 15:02:10 +0800 Subject: [PATCH] Fixed bug #71754 (Regression in PHP7.0: trivial script segfaults php-cgi) --- NEWS | 4 ++++ ext/session/session.c | 1 + 2 files changed, 5 insertions(+) diff --git a/NEWS b/NEWS index 0b21ac4b31..e70e4b4b0c 100644 --- a/NEWS +++ b/NEWS @@ -50,6 +50,10 @@ PHP NEWS - phpdbg: . Fixed crash when advancing (except step) inside an internal function. (Bob) +- Session: + . Fixed bug #71754 (Regression in PHP7.0: trivial script segfaults php-cgi). + (Laruence) + - SPL: . Fixed bug #71617 (private properties lost when unserializing ArrayObject). (Nikita) diff --git a/ext/session/session.c b/ext/session/session.c index 994d76217a..6e0c997843 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -1611,6 +1611,7 @@ PHPAPI void php_session_start(void) /* {{{ */ * '=' to allow URLs of the form * http://yoursite/=/script.php */ if (PS(define_sid) && !PS(id) && + !Z_ISUNDEF(PG(http_globals)[TRACK_VARS_SERVER]) && (data = zend_hash_str_find(Z_ARRVAL(PG(http_globals)[TRACK_VARS_SERVER]), "REQUEST_URI", sizeof("REQUEST_URI") - 1)) && Z_TYPE_P(data) == IS_STRING && (p = strstr(Z_STRVAL_P(data), PS(session_name))) && -- 2.40.0