From 9d4ede194fd6dee0b907aee635a2b218449d27a0 Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Wed, 2 Jul 2008 10:47:11 +0000 Subject: [PATCH] MFH: check return value of hash_find() --- ext/spl/spl_directory.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index 9d1a71d56b..9bd06e82ef 100755 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -1746,7 +1746,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_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); \ } /* }}} */ -- 2.40.0