mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Fixed bug #77439
This commit is contained in:
parent
7a88f89a90
commit
5d33024a5d
3 changed files with 18 additions and 0 deletions
2
NEWS
2
NEWS
|
@ -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
|
||||
|
||||
|
|
14
ext/standard/tests/strings/bug77439.phpt
Normal file
14
ext/standard/tests/strings/bug77439.phpt
Normal 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"
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue