From: Dmitry Stogov Date: Thu, 26 Oct 2017 10:11:59 +0000 (+0300) Subject: Merge branch 'PHP-7.0' into PHP-7.1 X-Git-Tag: php-7.2.0RC6~31^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=177cdcf3132f61d59bd6dc27bc819a4eb3545680;p=php Merge branch 'PHP-7.0' into PHP-7.1 * PHP-7.0: Fixed indirect modification of magic method arguments. --- 177cdcf3132f61d59bd6dc27bc819a4eb3545680 diff --cc Zend/zend_object_handlers.c index ed972c718c,8028b2ee5b..e8530340fb --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@@ -574,10 -507,10 +574,10 @@@ ZEND_API uint32_t *zend_get_property_gu zval *zend_std_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv) /* {{{ */ { zend_object *zobj; - zval tmp_member; + zval tmp_member, tmp_object; zval *retval; uint32_t property_offset; - zend_long *guard = NULL; + uint32_t *guard = NULL; zobj = Z_OBJ_P(object); @@@ -664,10 -602,17 +669,11 @@@ zval_ptr_dtor(&tmp_object); goto exit; } else { + zval_ptr_dtor(&tmp_object); - if (Z_STRVAL_P(member)[0] == '\0') { - if (Z_STRLEN_P(member) == 0) { - zend_throw_error(NULL, "Cannot access empty property"); - retval = &EG(uninitialized_zval); - goto exit; - } else { - zend_throw_error(NULL, "Cannot access property started with '\\0'"); - retval = &EG(uninitialized_zval); - goto exit; - } + if (Z_STRVAL_P(member)[0] == '\0' && Z_STRLEN_P(member) != 0) { + zend_throw_error(NULL, "Cannot access property started with '\\0'"); + retval = &EG(uninitialized_zval); + goto exit; } } }