File tree Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change 99 . Fixed bug #80602 (Segfault when using DOMChildNode::before()).
1010 (Nathan Freeman)
1111
12+ - PCRE:
13+ . Fixed bug GH-10968 (Segfault in preg_replace_callback_array()). (ilutov)
14+
1215- SPL:
1316 . Handle indirect zvals and use up-to-date properties in
1417 SplFixedArray::__serialize. (nielsdos)
Original file line number Diff line number Diff line change @@ -2457,7 +2457,12 @@ PHP_FUNCTION(preg_replace_callback_array)
24572457 }
24582458
24592459 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 ;
24612466 } else {
24622467 RETURN_STR (subject_str );
24632468 }
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