File tree Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,10 @@ PHP NEWS
46
46
. Fixed bug GH-19098 (libxml<2.13 segmentation fault caused by
47
47
php_libxml_node_free). (nielsdos)
48
48
49
+ - MbString:
50
+ . Fixed bug GH-19397 (mb_list_encodings() can cause crashes on shutdown).
51
+ (nielsdos)
52
+
49
53
- Opcache:
50
54
. Reset global pointers to prevent use-after-free in zend_jit_status().
51
55
(Florian Engelhardt)
Original file line number Diff line number Diff line change @@ -1165,8 +1165,8 @@ PHP_RSHUTDOWN_FUNCTION(mbstring)
1165
1165
MBSTRG (outconv_state ) = 0 ;
1166
1166
1167
1167
if (MBSTRG (all_encodings_list )) {
1168
- GC_DELREF ( MBSTRG ( all_encodings_list ));
1169
- zend_array_destroy (MBSTRG (all_encodings_list ));
1168
+ /* must be *array* release to remove from GC root buffer and free the hashtable itself */
1169
+ zend_array_release (MBSTRG (all_encodings_list ));
1170
1170
MBSTRG (all_encodings_list ) = NULL ;
1171
1171
}
1172
1172
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ GH-19397 (mb_list_encodings() can cause crashes on shutdown)
3
+ --EXTENSIONS--
4
+ mbstring
5
+ --FILE--
6
+ <?php
7
+ $ doNotDeleteThisVariableAssignment = mb_list_encodings ();
8
+ var_dump (count ($ doNotDeleteThisVariableAssignment ) > 0 );
9
+ ?>
10
+ --EXPECT--
11
+ bool(true)
You can’t perform that action at this time.
0 commit comments