Skip to content

Commit 572753f

Browse files
committed
ext/reflection: ensure __isset is not returning a reference before calling it
1 parent 061f90a commit 572753f

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

ext/reflection/php_reflection.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6724,6 +6724,11 @@ ZEND_METHOD(ReflectionProperty, isReadable)
67246724
handle_magic_get:
67256725
if (ce->__get) {
67266726
if (obj && ce->__isset) {
6727+
if (ce->__isset->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) {
6728+
zend_throw_exception(reflection_exception_ptr, "__isset should not return a reference", 0);
6729+
RETURN_THROWS();
6730+
}
6731+
67276732
uint32_t *guard = zend_get_property_guard(obj, ref->unmangled_name);
67286733
if (!((*guard) & ZEND_GUARD_PROPERTY_ISSET)) {
67296734
GC_ADDREF(obj);

0 commit comments

Comments
 (0)