mirror of
https://github.com/php/php-src.git
synced 2024-11-24 02:15:04 +08:00
Fixed Bug #68104 (Segfault while pre-evaluating a disabled function)
This commit is contained in:
parent
9e1da42af1
commit
d9d181e5ad
2
NEWS
2
NEWS
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
13
ext/opcache/tests/bug68104.phpt
Normal file
13
ext/opcache/tests/bug68104.phpt
Normal 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)
|
Loading…
Reference in New Issue
Block a user