From 59590663d786f52254a55ffa985fe2fb9b76bbf6 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Sat, 20 Feb 2021 11:20:29 +0300 Subject: [PATCH] Fixed NULL pointer dereference --- Zend/zend_closures.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c index 38105a67f6a..2eda4f8f5c9 100644 --- a/Zend/zend_closures.c +++ b/Zend/zend_closures.c @@ -620,7 +620,8 @@ static HashTable *zend_closure_get_gc(zend_object *obj, zval **table, int *n) /* *table = Z_TYPE(closure->this_ptr) != IS_NULL ? &closure->this_ptr : NULL; *n = Z_TYPE(closure->this_ptr) != IS_NULL ? 1 : 0; - return (closure->func.type == ZEND_USER_FUNCTION) ? + return (closure->func.type == ZEND_USER_FUNCTION && + closure->func.op_array.static_variables) ? ZEND_MAP_PTR_GET(closure->func.op_array.static_variables_ptr) : NULL; } /* }}} */