From cb7797a43c03d2ced07842647a5bb186a88d6473 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Fri, 28 Feb 2014 16:16:15 +0400 Subject: [PATCH] Fixed NULL pointer dereferencing --- Zend/zend_closures.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c index a8f2be30c86..8f60e670e58 100644 --- a/Zend/zend_closures.c +++ b/Zend/zend_closures.c @@ -431,7 +431,7 @@ ZEND_API void zend_create_closure(zval *res, zend_function *func, zend_class_ent closure->func = *func; closure->func.common.prototype = NULL; - if ((scope == NULL) && (Z_TYPE_P(this_ptr) != IS_UNDEF)) { + if ((scope == NULL) && this_ptr && (Z_TYPE_P(this_ptr) != IS_UNDEF)) { /* use dummy scope if we're binding an object without specifying a scope */ /* maybe it would be better to create one for this purpose */ scope = zend_ce_closure;