This commit is contained in:
Nikita Popov 2016-09-27 19:47:48 +02:00
parent cb29c01ed6
commit b7cbaa7f43
3 changed files with 29 additions and 3 deletions

4
NEWS
View File

@ -2,7 +2,9 @@ PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2016 PHP 7.0.13
- Core:
. Fixed bug #73181 (parse_str() without a second argument leads to crash).
(Nikita)
13 Oct 2016 PHP 7.0.12

20
Zend/tests/bug73181.phpt Normal file
View File

@ -0,0 +1,20 @@
--TEST--
Bug #73181: parse_str() without a second argument leads to crash
--FILE--
<?php
function x() {
parse_str("1&x");
var_dump(get_defined_vars());
}
x();
?>
--EXPECT--
array(2) {
[1]=>
string(0) ""
["x"]=>
string(0) ""
}

View File

@ -1447,13 +1447,17 @@ ZEND_API void ZEND_FASTCALL zend_symtable_clean(HashTable *ht)
} else if (ht->nNumUsed == ht->nNumOfElements) {
do {
i_zval_ptr_dtor(&p->val ZEND_FILE_LINE_CC);
zend_string_release(p->key);
if (EXPECTED(p->key)) {
zend_string_release(p->key);
}
} while (++p != end);
} else {
do {
if (EXPECTED(Z_TYPE(p->val) != IS_UNDEF)) {
i_zval_ptr_dtor(&p->val ZEND_FILE_LINE_CC);
zend_string_release(p->key);
if (EXPECTED(p->key)) {
zend_string_release(p->key);
}
}
} while (++p != end);
}