mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Add missing NULL checks for spl autoload table
Closes GH-12840.
This commit is contained in:
1
NEWS
1
NEWS
@@ -9,6 +9,7 @@ PHP NEWS
|
||||
php_message_handler_for_zend). (ilutov)
|
||||
. Fixed bug GH-12758 / GH-12768 (Invalid opline in OOM handlers within
|
||||
ZEND_FUNC_GET_ARGS and ZEND_BIND_STATIC). (Florian Engelhardt)
|
||||
. Fix various missing NULL checks. (nielsdos, dstogov)
|
||||
|
||||
- Date:
|
||||
. Fixed improbably integer overflow while parsing really large (or small)
|
||||
|
||||
@@ -585,8 +585,10 @@ PHP_FUNCTION(spl_autoload_unregister)
|
||||
|
||||
if (fcc.function_handler && zend_string_equals_literal(
|
||||
fcc.function_handler->common.function_name, "spl_autoload_call")) {
|
||||
/* Don't destroy the hash table, as we might be iterating over it right now. */
|
||||
zend_hash_clean(spl_autoload_functions);
|
||||
if (spl_autoload_functions) {
|
||||
/* Don't destroy the hash table, as we might be iterating over it right now. */
|
||||
zend_hash_clean(spl_autoload_functions);
|
||||
}
|
||||
RETURN_TRUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
--TEST--
|
||||
spl_autoload_unregister("spl_autoload_call") without registrations
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(spl_autoload_unregister("spl_autoload_call"));
|
||||
?>
|
||||
Done
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
Done
|
||||
Reference in New Issue
Block a user