Fixed Bug #68104 (Segfault while pre-evaluating a disabled function)

This commit is contained in:
Xinchen Hui 2014-10-31 17:32:23 +08:00
parent 9e1da42af1
commit d9d181e5ad
3 changed files with 21 additions and 9 deletions

2
NEWS
View File

@ -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

View File

@ -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;
}
/* }}} */

View File

@ -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)