mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Merge branch 'PHP-7.4'
* PHP-7.4: Fixed bug #79930 Fix iov_base pointer type for illumos Backport bless_tests.php changes from PHP 8
This commit is contained in:
commit
643145b59d
3 changed files with 35 additions and 2 deletions
|
@ -1025,7 +1025,7 @@ int zend_file_cache_script_store(zend_persistent_script *script, int in_shm)
|
|||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_UIO_H
|
||||
vec[0].iov_base = &info;
|
||||
vec[0].iov_base = (void *)&info;
|
||||
vec[0].iov_len = sizeof(info);
|
||||
vec[1].iov_base = buf;
|
||||
vec[1].iov_len = script->size;
|
||||
|
|
|
@ -3658,7 +3658,7 @@ PHPAPI int php_array_merge_recursive(HashTable *dest, HashTable *src) /* {{{ */
|
|||
return 0;
|
||||
}
|
||||
} else {
|
||||
Z_TRY_ADDREF_P(src_entry);
|
||||
Z_TRY_ADDREF_P(src_zval);
|
||||
zend_hash_next_index_insert(Z_ARRVAL_P(dest_zval), src_zval);
|
||||
}
|
||||
zval_ptr_dtor(&tmp);
|
||||
|
|
33
ext/standard/tests/array/bug79930.phpt
Normal file
33
ext/standard/tests/array/bug79930.phpt
Normal file
|
@ -0,0 +1,33 @@
|
|||
--TEST--
|
||||
Bug #79930: array_merge_recursive() crashes when called with array with single reference
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$a = 'a';
|
||||
$array = [
|
||||
'value' => $a . 'b',
|
||||
];
|
||||
|
||||
// Create rc=1 reference.
|
||||
array_walk($array, function () {});
|
||||
|
||||
$m = array_merge_recursive(['value' => 'a'], $array);
|
||||
|
||||
var_dump($a, $array, $m);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(1) "a"
|
||||
array(1) {
|
||||
["value"]=>
|
||||
string(2) "ab"
|
||||
}
|
||||
array(1) {
|
||||
["value"]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(1) "a"
|
||||
[1]=>
|
||||
string(2) "ab"
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue