File tree 3 files changed +20
-1
lines changed
3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change 9
9
. Fixed bug #80602 (Segfault when using DOMChildNode::before()).
10
10
(Nathan Freeman)
11
11
12
+ - PCRE:
13
+ . Fixed bug GH-10968 (Segfault in preg_replace_callback_array()). (ilutov)
14
+
12
15
- SPL:
13
16
. Handle indirect zvals and use up-to-date properties in
14
17
SplFixedArray::__serialize. (nielsdos)
Original file line number Diff line number Diff line change @@ -2457,7 +2457,12 @@ PHP_FUNCTION(preg_replace_callback_array)
2457
2457
}
2458
2458
2459
2459
if (subject_ht ) {
2460
- RETURN_ARR (subject_ht );
2460
+ RETVAL_ARR (subject_ht );
2461
+ // Unset the type_flags of immutable arrays to prevent the VM from performing refcounting
2462
+ if (GC_FLAGS (subject_ht ) & IS_ARRAY_IMMUTABLE ) {
2463
+ Z_TYPE_FLAGS_P (return_value ) = 0 ;
2464
+ }
2465
+ return ;
2461
2466
} else {
2462
2467
RETURN_STR (subject_str );
2463
2468
}
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ GH-10968: preg_replace_callback_array() segmentation fault
3
+ --FILE--
4
+ <?php
5
+ var_dump (preg_replace_callback_array ([], []));
6
+ var_dump (preg_replace_callback_array ([], '' ));
7
+ ?>
8
+ --EXPECT--
9
+ array(0) {
10
+ }
11
+ string(0) ""
You can’t perform that action at this time.
0 commit comments