php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #62737
Patch bug62737.phpt revision 2012-08-04 15:14 UTC by laruence@php.net
Patch bug62737.patch revision 2012-08-04 15:13 UTC by laruence@php.net
Patch ChangeDisableClassHandler.patch revision 2012-08-03 16:21 UTC by laruence@php.net
revision 2012-08-03 15:02 UTC by laruence@php.net

Patch ChangeDisableClassHandler.patch for Reproducible crash Bug #62737

Patch version 2012-08-03 15:02 UTC

Return to Bug #62737 | Download this patch
This patch is obsolete

Obsoleted by patches:

Patch Revisions:

Developer: laruence@php.net

diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index 6d2ccd2..e0bda47 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -2342,16 +2342,15 @@ 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);
+	(*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 +2424,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;
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 08:01:29 2024 UTC