mirror of
https://github.com/php/php-src.git
synced 2024-09-27 21:07:25 +00:00
use zend_ascii_hash_find() and check its return value to prevent crash when function not found
This commit is contained in:
parent
86151ca664
commit
15e70c34e2
@ -1870,7 +1870,12 @@ static int spl_filesystem_file_call(spl_filesystem_object *intern, zend_function
|
||||
#define FileFunctionCall(func_name, pass_num_args, arg2) /* {{{ */\
|
||||
{ \
|
||||
zend_function *func_ptr; \
|
||||
zend_hash_find(EG(function_table), #func_name, sizeof(#func_name), (void **) &func_ptr); \
|
||||
int ret; \
|
||||
ret = zend_ascii_hash_find(EG(function_table), #func_name, sizeof(#func_name), (void **) &func_ptr); \
|
||||
if (ret != SUCCESS) { \
|
||||
zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Internal error, function '%s' not found. Please report", #func_name); \
|
||||
return; \
|
||||
} \
|
||||
spl_filesystem_file_call(intern, func_ptr, pass_num_args, return_value, arg2 TSRMLS_CC); \
|
||||
} /* }}} */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user