This commit is contained in:
Nikita Popov 2019-01-10 10:55:19 +01:00
parent 7a88f89a90
commit 5d33024a5d
3 changed files with 18 additions and 0 deletions

2
NEWS
View file

@ -22,6 +22,8 @@ PHP NEWS
- Standard:
. Fixed bug #77395 (segfault about array_multisort). (Laruence)
. Fixed bug #77439 (parse_str segfaults when inserting item into existing
array). (Nikita)
10 Jan 2019, PHP 7.2.14

View file

@ -0,0 +1,14 @@
--TEST--
Bug #77439: parse_str segfaults when inserting item into existing array
--FILE--
<?php
$a = [];
parse_str('a[1]=1');
var_dump($a);
?>
--EXPECTF--
Deprecated: parse_str(): Calling parse_str() without the result argument is deprecated in %s on line %d
array(1) {
[1]=>
string(1) "1"
}

View file

@ -218,6 +218,8 @@ PHPAPI void php_register_variable_ex(char *var_name, zval *val, zval *track_vars
if (Z_TYPE_P(gpc_element_p) != IS_ARRAY) {
zval_ptr_dtor(gpc_element_p);
array_init(gpc_element_p);
} else {
SEPARATE_ARRAY(gpc_element_p);
}
}
}