Skip to content

Commit 643145b

Browse files
committed
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
2 parents 002908a + 6bf8ff6 commit 643145b

File tree

3 files changed

+35
-2
lines changed

3 files changed

+35
-2
lines changed

ext/opcache/zend_file_cache.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1025,7 +1025,7 @@ int zend_file_cache_script_store(zend_persistent_script *script, int in_shm)
10251025
#endif
10261026

10271027
#ifdef HAVE_SYS_UIO_H
1028-
vec[0].iov_base = &info;
1028+
vec[0].iov_base = (void *)&info;
10291029
vec[0].iov_len = sizeof(info);
10301030
vec[1].iov_base = buf;
10311031
vec[1].iov_len = script->size;

ext/standard/array.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3658,7 +3658,7 @@ PHPAPI int php_array_merge_recursive(HashTable *dest, HashTable *src) /* {{{ */
36583658
return 0;
36593659
}
36603660
} else {
3661-
Z_TRY_ADDREF_P(src_entry);
3661+
Z_TRY_ADDREF_P(src_zval);
36623662
zend_hash_next_index_insert(Z_ARRVAL_P(dest_zval), src_zval);
36633663
}
36643664
zval_ptr_dtor(&tmp);
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
--TEST--
2+
Bug #79930: array_merge_recursive() crashes when called with array with single reference
3+
--FILE--
4+
<?php
5+
6+
$a = 'a';
7+
$array = [
8+
'value' => $a . 'b',
9+
];
10+
11+
// Create rc=1 reference.
12+
array_walk($array, function () {});
13+
14+
$m = array_merge_recursive(['value' => 'a'], $array);
15+
16+
var_dump($a, $array, $m);
17+
18+
?>
19+
--EXPECT--
20+
string(1) "a"
21+
array(1) {
22+
["value"]=>
23+
string(2) "ab"
24+
}
25+
array(1) {
26+
["value"]=>
27+
array(2) {
28+
[0]=>
29+
string(1) "a"
30+
[1]=>
31+
string(2) "ab"
32+
}
33+
}

0 commit comments

Comments
 (0)