summaryrefslogtreecommitdiff
path: root/ext/reflection/php_reflection.c
diff options
context:
space:
mode:
authorJoe Watkins <krakjoe@php.net>2016-05-14 06:28:11 +0100
committerJoe Watkins <krakjoe@php.net>2016-05-14 06:28:11 +0100
commit3684d411721c3b5dc85be74c5317e4d6311ad021 (patch)
tree71a797644e28f23d8997bc48637da9d22b37b489 /ext/reflection/php_reflection.c
parent49a7be069700efbb98dbb076bb0891c748c343f4 (diff)
downloadphp-git-3684d411721c3b5dc85be74c5317e4d6311ad021.tar.gz
fix #72209 (ReflectionProperty::getValue() doesn't fail if object doesn't match type)
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r--ext/reflection/php_reflection.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 38cfec6aa9..13003cae84 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -5648,6 +5648,11 @@ ZEND_METHOD(reflection_property, getValue)
return;
}
+ if (!instanceof_function(Z_OBJCE_P(object), ref->ce)) {
+ _DO_THROW("Given object is not an instance of the class this property was declared in");
+ /* Returns from this function */
+ }
+
zend_unmangle_property_name_ex(ref->prop.name, &class_name, &prop_name, &prop_name_len);
member_p = zend_read_property(ref->ce, object, prop_name, prop_name_len, 0, &rv);
if (member_p != &rv) {