mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-07 17:27:30 +00:00
Merge branch 'PHP-5.6'
Conflicts: Zend/zend_API.c
This commit is contained in:
commit
ccb09eb352
2 files changed
+23
-12
No files matched your search
+6
-12
@@ -2754,21 +2754,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, size_t function_name_length TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = zend_hash_str_del(CG(function_table), function_name, function_name_length);
|
||||
if (ret == FAILURE) {
|
||||
return FAILURE;
|
||||
zend_internal_function *func;
|
||||
if ((func = zend_hash_str_find_ptr(CG(function_table), function_name, function_name_length))) {
|
||||
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;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
--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"));
|
||||
dl("a.so");
|
||||
?>
|
||||
--EXPECTF--
|
||||
bool(true)
|
||||
|
||||
Warning: dl() has been disabled for security reasons in %sbug68104.php on line %d
|
||||
Reference in new issue
Block a user