diff options
author | Benjamin Eberlei <kontakt@beberlei.de> | 2020-11-15 08:45:26 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-11-17 10:54:27 +0100 |
commit | 1727d96d0e1057ce140682b79d7f121dee0fc370 (patch) | |
tree | 0d5556885268e3be19d0e84094dbd48bf146a3f1 /ext/reflection/php_reflection.c | |
parent | 58d41b8c4f9e8006f6c136186ef4788b1cc901dc (diff) | |
download | php-git-1727d96d0e1057ce140682b79d7f121dee0fc370.tar.gz |
Fixed bug #80370: Segmentation fault reflecting attributes of dynamic property
Closes GH-6428.
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r-- | ext/reflection/php_reflection.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 2be0ab98db..114b2c273f 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -5498,6 +5498,10 @@ ZEND_METHOD(ReflectionProperty, getAttributes) GET_REFLECTION_OBJECT_PTR(ref); + if (ref->prop == NULL) { + RETURN_EMPTY_ARRAY(); + } + reflect_attributes(INTERNAL_FUNCTION_PARAM_PASSTHRU, ref->prop->attributes, 0, ref->prop->ce, ZEND_ATTRIBUTE_TARGET_PROPERTY, ref->prop->ce->type == ZEND_USER_CLASS ? ref->prop->ce->info.user.filename : NULL); |