com php-src: Fixed access to undefined properties: Zend/zend_ object_handlers.c
| From: | Dmitry Stogov | Date: | Fri, 28 Feb 2014 12:56:52 +0000 |
| Subject: | com php-src: Fixed access to undefined properties: Zend/zend_ object_handlers.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-77769@lists.php.net to get a copy of this message | ||
Commit: e26722c2fa7ac03e042f0932c8f819d79a52ea3a
Author: Dmitry Stogov <dmitry@zend.com> Fri, 28 Feb 2014 16:56:52 +0400
Parents: cb7797a43c03d2ced07842647a5bb186a88d6473
Branches: phpng
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e26722c2fa7ac03e042f0932c8f819d79a52ea3a
Log:
Fixed access to undefined properties
Changed paths:
M Zend/zend_object_handlers.c
Diff:
diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c
index 62c8ad4..4b40fca 100644
--- a/Zend/zend_object_handlers.c
+++ b/Zend/zend_object_handlers.c
@@ -393,6 +393,7 @@ static long *zend_get_property_guard(zend_object *zobj, zend_property_info *prop
{
zend_property_info info;
zval stub, *guard;
+ zend_string *str = NULL;
if (!property_info) {
property_info = &info;
@@ -402,7 +403,7 @@ static long *zend_get_property_guard(zend_object *zobj, zend_property_info *prop
zend_unmangle_property_name(property_info->name->val, property_info->name->len,
&class_name, &prop_name);
if (class_name) {
/* use unmangled name for protected properties */
- info.name = STR_INIT(prop_name, strlen(prop_name), 0);
+ str = info.name = STR_INIT(prop_name, strlen(prop_name), 0);
property_info = &info;
}
}
@@ -410,11 +411,17 @@ static long *zend_get_property_guard(zend_object *zobj, zend_property_info
*prop
ALLOC_HASHTABLE(zobj->guards);
zend_hash_init(zobj->guards, 0, NULL, NULL, 0);
} else if ((guard = zend_hash_find(zobj->guards, property_info->name)) != NULL) {
+ if (str) {
+ STR_RELEASE(str);
+ }
return &Z_LVAL_P(guard);
}
ZVAL_LONG(&stub, 0);
guard = zend_hash_add(zobj->guards, property_info->name, &stub);
+ if (str) {
+ STR_RELEASE(str);
+ }
return &Z_LVAL_P(guard);
}
/* }}} */
@@ -508,6 +515,10 @@ zval *zend_std_read_property(zval *object, zval *member, int type, const
zend_li
zend_error(E_ERROR, "Cannot access property started with '\\0'");
}
}
+ if (!silent) {
+ zend_error(E_NOTICE,"Undefined property: %s::$%s", zobj->ce->name->val,
Z_STRVAL_P(member));
+ }
+ retval = &EG(uninitialized_zval);
}
} else {
if (!silent) {