summaryrefslogtreecommitdiff
path: root/Zend/zend_API.c
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2012-08-04 10:41:26 +0800
committerXinchen Hui <laruence@php.net>2012-08-04 10:41:26 +0800
commit03a1fcabf31210d3f304bfacf5096ce43c2b8f93 (patch)
tree53b8940d4d584f43ee9dc7941d0532072f2030d5 /Zend/zend_API.c
parent49b202f2cfe04d577671b685b7c0d3a096a433c7 (diff)
downloadphp-git-03a1fcabf31210d3f304bfacf5096ce43c2b8f93.tar.gz
Fixed bug #62744 (dangling pointers made by zend_disable_class)
the test will be added while commit the fix for #62737
Diffstat (limited to 'Zend/zend_API.c')
-rw-r--r--Zend/zend_API.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index 6d2ccd2c69..16a940dcac 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -2342,16 +2342,16 @@ static const zend_function_entry disabled_class_new[] = {
ZEND_API int zend_disable_class(char *class_name, uint class_name_length TSRMLS_DC) /* {{{ */
{
- zend_class_entry disabled_class;
+ zend_class_entry **disabled_class;
zend_str_tolower(class_name, class_name_length);
- if (zend_hash_del(CG(class_table), class_name, class_name_length+1)==FAILURE) {
+ if (zend_hash_find(CG(class_table), class_name, class_name_length+1, (void **)&disabled_class)==FAILURE) {
return FAILURE;
}
- INIT_OVERLOADED_CLASS_ENTRY_EX(disabled_class, class_name, class_name_length, disabled_class_new, NULL, NULL, NULL, NULL, NULL);
- disabled_class.create_object = display_disabled_class;
- disabled_class.name_length = class_name_length;
- zend_register_internal_class(&disabled_class TSRMLS_CC);
+ INIT_CLASS_ENTRY_INIT_METHODS((**disabled_class), disabled_class_new, NULL, NULL, NULL, NULL, NULL);
+ (*disabled_class)->create_object = display_disabled_class;
+ (*disabled_class)->builtin_functions = disabled_class_new;
+ zend_hash_clean(&((*disabled_class)->function_table));
return SUCCESS;
}
/* }}} */
@@ -2425,7 +2425,6 @@ static int zend_is_callable_check_class(const char *name, int name_len, zend_fca
}
/* }}} */
-
static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fcall_info_cache *fcc, int strict_class, char **error TSRMLS_DC) /* {{{ */
{
zend_class_entry *ce_org = fcc->calling_scope;