tony2001 Wed Jul 2 10:47:12 2008 UTC
Modified files: (Branch: PHP_5_3)
/php-src/ext/spl spl_directory.c
Log:
MFH: check return value of hash_find()
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.45.2.27.2.23.2.22&r2=1.45.2.27.2.23.2.23&diff_format=u
Index: php-src/ext/spl/spl_directory.c
diff -u php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.22
php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.23
--- php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.22 Wed Jun 18 10:05:29 2008
+++ php-src/ext/spl/spl_directory.c Wed Jul 2 10:47:11 2008
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.22 2008/06/18 10:05:29 colder Exp $
*/
+/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.23 2008/07/02 10:47:11 tony2001 Exp
$ */
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -1746,7 +1746,12 @@
#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); \
} /* }}} */
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php