]> granicus.if.org Git - php/commitdiff
Fixed NULL pointer dereferencing
authorDmitry Stogov <dmitry@zend.com>
Fri, 28 Feb 2014 12:16:15 +0000 (16:16 +0400)
committerDmitry Stogov <dmitry@zend.com>
Fri, 28 Feb 2014 12:16:15 +0000 (16:16 +0400)
Zend/zend_closures.c

index a8f2be30c867f7a54d3978781604ea43ae13cda9..8f60e670e58ebbe5ee254716f5716c41466ffce2 100644 (file)
@@ -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;