]> granicus.if.org Git - php/commitdiff
Fix nullptr dereference in clean without exec context
authorBob Weinand <bobwei9@hotmail.com>
Sun, 26 Oct 2014 09:48:45 +0000 (10:48 +0100)
committerBob Weinand <bobwei9@hotmail.com>
Sun, 26 Oct 2014 09:48:45 +0000 (10:48 +0100)
phpdbg_prompt.c

index 29c75c583c06099898470b1b9e877badf0e7478e..eca4c6ac2ba8d8f1c3188cd1edb05ae2be7d25c7 100644 (file)
@@ -1320,7 +1320,10 @@ void phpdbg_clean(zend_bool full TSRMLS_DC) /* {{{ */
        }
 
        if (full) {
-               phpdbg_exec = strdup(PHPDBG_G(exec)); /* preserve exec, don't reparse that from cmd */
+               if (PHPDBG_G(exec)) {
+                       phpdbg_exec = strdup(PHPDBG_G(exec)); /* preserve exec, don't reparse that from cmd */
+               }
+
                PHPDBG_G(flags) |= PHPDBG_IS_CLEANING;
 
                zend_bailout();