diff options
author | Antony Dovgal <tony2001@php.net> | 2005-09-16 17:05:09 +0000 |
---|---|---|
committer | Antony Dovgal <tony2001@php.net> | 2005-09-16 17:05:09 +0000 |
commit | f43767b249f0bcf05582a75b7024e171f815c5db (patch) | |
tree | 119c5e5659eb36d04814e082cbd9cf4f3c8255f6 /Zend/zend_builtin_functions.c | |
parent | 27763b36665f2dea411c5c660e2809db63e289d2 (diff) | |
download | php-git-f43767b249f0bcf05582a75b7024e171f815c5db.tar.gz |
fix #34505 (possible memory corruption when unmangling properties with empty names)
1st part
Diffstat (limited to 'Zend/zend_builtin_functions.c')
-rw-r--r-- | Zend/zend_builtin_functions.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index ccadc146de..6b0d3d07c6 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -690,7 +690,7 @@ static void add_class_vars(zend_class_entry *ce, HashTable *properties, zval *re zend_hash_get_current_key_ex(properties, &key, &key_len, &num_index, 0, &pos); zend_hash_move_forward_ex(properties, &pos); - zend_unmangle_property_name(key, &class_name, &prop_name); + zend_unmangle_property_name_ex(key, key_len, &class_name, &prop_name); if (class_name) { if (class_name[0] != '*' && strcmp(class_name, ce->name)) { /* filter privates from base classes */ @@ -782,7 +782,7 @@ ZEND_FUNCTION(get_object_vars) (*value)->refcount++; add_assoc_zval_ex(return_value, key, key_len, *value); } else if (instanceof) { - zend_unmangle_property_name(key, &class_name, &prop_name); + zend_unmangle_property_name_ex(key, key_len, &class_name, &prop_name); if (!memcmp(class_name, "*", 2) || (Z_OBJCE_P(EG(This)) == Z_OBJCE_PP(obj) && !strcmp(Z_OBJCE_P(EG(This))->name, class_name))) { /* Not separating references */ (*value)->refcount++; @@ -931,7 +931,7 @@ ZEND_FUNCTION(property_exists) if (property_info->flags & ZEND_ACC_PUBLIC) { RETURN_TRUE; } - zend_unmangle_property_name(property_info->name, &class_name, &prop_name); + zend_unmangle_property_name_ex(property_info->name, property_info->name_length, &class_name, &prop_name); if (!strncmp(class_name, "*", 1)) { if (instanceof_function(EG(scope), ce TSRMLS_CC)) { RETURN_TRUE; |