php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80370 getAttributes segfault on dynamic properties
Submitted: 2020-11-15 00:43 UTC Modified: 2020-11-15 07:32 UTC
From: gmblar+php at gmail dot com Assigned: beberlei (profile)
Status: Closed Package: Reflection related
PHP Version: 8.0.0RC4 OS: Docker
Private report: No CVE-ID: None
 [2020-11-15 00:43 UTC] gmblar+php at gmail dot com
Description:
------------
getAttributes segfault on dynamic properties

Test script:
---------------
class Foobar {

}

$foobar = new Foobar();
$foobar->bar = 42;

$reflectionObject = new ReflectionObject($foobar);
$reflectionProperty = $reflectionObject->getProperty('bar');
$reflectionProperty->getAttributes();

Expected result:
----------------
Nothing

Actual result:
--------------
AH00052: child pid 40 exit signal Segmentation fault (11)

Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-11-15 01:31 UTC] requinix@php.net
-Status: Open +Status: Verified
 [2020-11-15 01:31 UTC] requinix@php.net
ReflectionProperty::getAttributes (ext/reflection/php_reflection.c:5468)

reflect_attributes(INTERNAL_FUNCTION_PARAM_PASSTHRU, ref->prop->attributes, 0, ref->prop->ce, ZEND_ATTRIBUTE_TARGET_PROPERTY);

ref->prop is NULL.
 [2020-11-15 07:32 UTC] beberlei@php.net
-Assigned To: +Assigned To: beberlei
 [2020-11-15 07:49 UTC] beberlei@php.net
The following pull request has been associated:

Patch Name: Fixed bug #80370: Segmentation fault on ReflectionProperty::getAttrib…
On GitHub:  https://github.com/php/php-src/pull/6428
Patch:      https://github.com/php/php-src/pull/6428.patch
 [2020-11-17 09:54 UTC] nikic@php.net
Automatic comment on behalf of kontakt@beberlei.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=1727d96d0e1057ce140682b79d7f121dee0fc370
Log: Fixed bug #80370: Segmentation fault reflecting attributes of dynamic property
 [2020-11-17 09:54 UTC] nikic@php.net
-Status: Verified +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 11:01:27 2024 UTC