Merge branch 'PHP-7.0'

* PHP-7.0:
  Fixed Bug #71683 Null pointer dereference in zend_hash_str_find_bucket
This commit is contained in:
Yasuo Ohgaki 2016-03-12 08:33:04 +09:00
commit 01579ae0a6
2 changed files with 17 additions and 1 deletions

View File

@ -1632,7 +1632,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]) &&
zend_is_auto_global_str("_SERVER", sizeof("_SERVER") - 1) == SUCCESS &&
(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))) &&

View File

@ -0,0 +1,16 @@
--TEST--
Bug #71683 Null pointer dereference in zend_hash_str_find_bucket
--SKIPIF--
<?php include('skipif.inc'); ?>
--INI--
session.save_handler=files
session.auto_start=1
session.use_only_cookies=0
--FILE--
<?php
ob_start();
echo "ok\n";
?>
--EXPECTF--
ok