diff options
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | Zend/zend_API.c | 15 | ||||
-rw-r--r-- | ext/opcache/tests/bug68104.phpt | 13 |
3 files changed, 21 insertions, 9 deletions
@@ -7,6 +7,8 @@ PHP NEWS ?? ??? 2014, PHP 5.6.3 - Core: + . Fixed bug #68104 (Segfault while pre-evaluating a disabled function). + (Laruence) . Implemented 64-bit format codes for pack() and unpack(). (Leigh) . Fixed bug #51800 (proc_open on Windows hangs forever). (Anatol) . Fixed bug #67633 (A foreach on an array returned from a function not doing diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 8472cd7ab1..a465721f1f 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -2635,18 +2635,15 @@ ZEND_API ZEND_FUNCTION(display_disabled_function) } /* }}} */ -static zend_function_entry disabled_function[] = { - ZEND_FE(display_disabled_function, NULL) - ZEND_FE_END -}; - ZEND_API int zend_disable_function(char *function_name, uint function_name_length TSRMLS_DC) /* {{{ */ { - if (zend_hash_del(CG(function_table), function_name, function_name_length+1)==FAILURE) { - return FAILURE; + zend_internal_function *func; + if (zend_hash_find(CG(function_table), function_name, function_name_length+1, (void **)&func)==SUCCESS) { + func->arg_info = NULL; + func->handler = ZEND_FN(display_disabled_function); + return SUCCESS; } - disabled_function[0].fname = function_name; - return zend_register_functions(NULL, disabled_function, CG(function_table), MODULE_PERSISTENT TSRMLS_CC); + return FAILURE; } /* }}} */ diff --git a/ext/opcache/tests/bug68104.phpt b/ext/opcache/tests/bug68104.phpt new file mode 100644 index 0000000000..521486ef58 --- /dev/null +++ b/ext/opcache/tests/bug68104.phpt @@ -0,0 +1,13 @@ +--TEST-- +Bug #68104 (Segfault while pre-evaluating a disabled function) +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +disable_functions=dl +--SKIPIF-- +<?php require_once('skipif.inc'); ?> +--FILE-- +<?php +var_dump(is_callable("dl")); +--EXPECT-- +bool(true) |