Skip to content

Commit d354d83

Browse files
committed
Fix GH-20286: use-after-destroy during userland stream_close().
1 parent 6fe40de commit d354d83

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Zend/zend_execute_API.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,6 +1077,14 @@ ZEND_API zend_result zend_call_method_if_exists(
10771077
zend_object *object, zend_string *method_name, zval *retval,
10781078
uint32_t param_count, zval *params)
10791079
{
1080+
if (UNEXPECTED(!EG(active))) {
1081+
#if ZEND_DEBUG
1082+
ZEND_UNREACHABLE();
1083+
#endif
1084+
ZVAL_UNDEF(retval);
1085+
return FAILURE;
1086+
}
1087+
10801088
zend_fcall_info fci;
10811089
fci.size = sizeof(zend_fcall_info);
10821090
fci.object = object;

0 commit comments

Comments
 (0)