]> granicus.if.org Git - php/commitdiff
Fixed bug #71754 (Regression in PHP7.0: trivial script segfaults php-cgi)
authorXinchen Hui <laruence@gmail.com>
Thu, 10 Mar 2016 07:02:10 +0000 (15:02 +0800)
committerXinchen Hui <laruence@gmail.com>
Thu, 10 Mar 2016 07:02:10 +0000 (15:02 +0800)
NEWS
ext/session/session.c

diff --git a/NEWS b/NEWS
index 0b21ac4b3162e4056ab7866e3cf2e957fc68e16d..e70e4b4b0c9ed76d0dd9a432d811c44e19855be9 100644 (file)
--- 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)
index 994d76217abc381528a4c29a3f48c1fc6fd2242b..6e0c9978430f166b1d2e3da130943ffc5b8b81eb 100644 (file)
@@ -1611,6 +1611,7 @@ PHPAPI void php_session_start(void) /* {{{ */
                 * '<session-name>=<session-id>' to allow URLs of the form
                 * http://yoursite/<session-name>=<session-id>/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))) &&