summaryrefslogtreecommitdiff
path: root/sapi/phpdbg/phpdbg_prompt.c
diff options
context:
space:
mode:
authorBob Weinand <bobwei9@hotmail.com>2014-10-26 10:48:45 +0100
committerBob Weinand <bobwei9@hotmail.com>2014-10-27 00:00:15 +0100
commit69bc61de419ccd92bfa308f356b56591f7696413 (patch)
treef84e8e15037026d0cf1686a2fe04ed4ae9923a28 /sapi/phpdbg/phpdbg_prompt.c
parent41537cdddc71a6e499f1c7c118bf862105ff95fa (diff)
downloadphp-git-69bc61de419ccd92bfa308f356b56591f7696413.tar.gz
Fix nullptr dereference in clean without exec context
Diffstat (limited to 'sapi/phpdbg/phpdbg_prompt.c')
-rw-r--r--sapi/phpdbg/phpdbg_prompt.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c
index 29c75c583c..eca4c6ac2b 100644
--- a/sapi/phpdbg/phpdbg_prompt.c
+++ b/sapi/phpdbg/phpdbg_prompt.c
@@ -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();