From: Felipe Pena Date: Tue, 12 May 2009 22:50:56 +0000 (+0000) Subject: - Fixed bug #48248 (SIGSEGV when access to private property via &__get) X-Git-Tag: php-5.4.0alpha1~191^2~3681 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7ff880405f00ab8697227faa68886fc2465c5afb;p=php - Fixed bug #48248 (SIGSEGV when access to private property via &__get) --- diff --git a/Zend/tests/bug48248.phpt b/Zend/tests/bug48248.phpt new file mode 100644 index 0000000000..9cdb7c1a00 --- /dev/null +++ b/Zend/tests/bug48248.phpt @@ -0,0 +1,27 @@ +--TEST-- +Bug #48248 (SIGSEGV when access to private property via &__get) +--FILE-- +test; + } +} + +class B extends A +{ + private $test; +} + +$b = new B; +var_dump($b->test); + +?> +--EXPECTF-- +Notice: Undefined property: B::$test in %s on line %d + +Notice: Only variable references should be returned by reference in %s on line %d +NULL diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index 82b308b472..6564e050a1 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -583,8 +583,8 @@ static zval **zend_std_get_property_ptr_ptr(zval *object, zval *member TSRMLS_DC zend_guard *guard; if (!zobj->ce->__get || - zend_get_property_guard(zobj, property_info, member, &guard TSRMLS_CC) != SUCCESS || - guard->in_get) { + zend_get_property_guard(zobj, property_info, member, &guard TSRMLS_CC) != SUCCESS || + (property_info && guard->in_get)) { /* we don't have access controls - will just add it */ new_zval = &EG(uninitialized_zval);