]> granicus.if.org Git - php/commitdiff
Fixed NULL pointer dereference
authorXinchen Hui <laruence@gmail.com>
Mon, 17 Mar 2014 04:05:52 +0000 (12:05 +0800)
committerXinchen Hui <laruence@gmail.com>
Mon, 17 Mar 2014 04:05:52 +0000 (12:05 +0800)
ext/reflection/php_reflection.c

index 20d644d80445d348568ba2e19cdba8da4c1c5ca2..c6fa805d989e97a6b715c116e615a04fedead805 100644 (file)
@@ -2983,7 +2983,11 @@ ZEND_METHOD(reflection_method, invokeArgs)
        fcc.function_handler = mptr;
        fcc.calling_scope = obj_ce;
        fcc.called_scope = intern->ce;
-       ZVAL_COPY_VALUE(&fcc.object, object);
+       if (object) {
+               ZVAL_COPY_VALUE(&fcc.object, object);
+       } else {
+               ZVAL_UNDEF(&fcc.object);
+       }
        
        /* 
         * Copy the zend_function when calling via handler (e.g. Closure::__invoke())