Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions Zend/tests/lazy_objects/oss_fuzz_71382.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
--TEST--
oss-fuzz #71382
--FILE--
<?php

class C {
public $a;
public $b {
get {
}
}
}

$reflector = new ReflectionClass(C::class);
$obj = $reflector->newLazyGhost(function() {
throw new \Exception('initializer');
});

try {
foreach($obj as $a) {
}
} catch (Exception $e) {
printf("%s: %s\n", $e::class, $e->getMessage());
}

--EXPECT--
Exception: initializer
2 changes: 1 addition & 1 deletion Zend/zend_property_hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ static zend_array *zho_build_properties_ex(zend_object *zobj, bool check_access,
if (UNEXPECTED(zend_lazy_object_must_init(zobj))) {
zobj = zend_lazy_object_init(zobj);
if (UNEXPECTED(!zobj)) {
return (zend_array*) &zend_empty_array;
return zend_new_array(0);
}
}

Expand Down
Loading