mirror of
https://github.com/php/php-src.git
synced 2025-08-15 13:38:49 +02:00
Merge branch 'PHP-8.4'
* PHP-8.4: Fix GH-19397: mb_list_encodings() can cause crashes on shutdown
This commit is contained in:
commit
be2889411a
2 changed files with 13 additions and 2 deletions
|
@ -1160,8 +1160,8 @@ PHP_RSHUTDOWN_FUNCTION(mbstring)
|
||||||
MBSTRG(outconv_state) = 0;
|
MBSTRG(outconv_state) = 0;
|
||||||
|
|
||||||
if (MBSTRG(all_encodings_list)) {
|
if (MBSTRG(all_encodings_list)) {
|
||||||
GC_DELREF(MBSTRG(all_encodings_list));
|
/* must be *array* release to remove from GC root buffer and free the hashtable itself */
|
||||||
zend_array_destroy(MBSTRG(all_encodings_list));
|
zend_array_release(MBSTRG(all_encodings_list));
|
||||||
MBSTRG(all_encodings_list) = NULL;
|
MBSTRG(all_encodings_list) = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
11
ext/mbstring/tests/gh19397.phpt
Normal file
11
ext/mbstring/tests/gh19397.phpt
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
--TEST--
|
||||||
|
GH-19397 (mb_list_encodings() can cause crashes on shutdown)
|
||||||
|
--EXTENSIONS--
|
||||||
|
mbstring
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
$doNotDeleteThisVariableAssignment = mb_list_encodings();
|
||||||
|
var_dump(count($doNotDeleteThisVariableAssignment) > 0);
|
||||||
|
?>
|
||||||
|
--EXPECT--
|
||||||
|
bool(true)
|
Loading…
Add table
Add a link
Reference in a new issue