We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b389846 commit 30570b6Copy full SHA for 30570b6
ext/mbstring/mbstring.c
@@ -1158,6 +1158,7 @@ PHP_RSHUTDOWN_FUNCTION(mbstring)
1158
MBSTRG(outconv_state) = 0;
1159
1160
if (MBSTRG(all_encodings_list)) {
1161
+ GC_REMOVE_FROM_BUFFER(MBSTRG(all_encodings_list));
1162
GC_DELREF(MBSTRG(all_encodings_list));
1163
zend_hash_destroy(MBSTRG(all_encodings_list));
1164
efree(MBSTRG(all_encodings_list));
ext/mbstring/tests/mb_list_encodings_gc_uaf.phpt
@@ -0,0 +1,9 @@
1
+--TEST--
2
+Use-after-free of MBSTRG(all_encodings_list) on shutdown
3
+--EXTENSIONS--
4
+mbstring
5
+--FILE--
6
+<?php
7
+mb_list_encodings();
8
+?>
9
+--EXPECT--
0 commit comments