From: Nikita Popov Date: Fri, 21 Jun 2019 14:52:08 +0000 (+0200) Subject: Fix stack leak in phpdbg X-Git-Tag: php-7.4.0alpha2~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=152ccfb08dd766cdb76583b061dcc2c8a73a7255;p=php Fix stack leak in phpdbg --- diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c index e1bfeb45da..248391b188 100644 --- a/sapi/phpdbg/phpdbg_prompt.c +++ b/sapi/phpdbg/phpdbg_prompt.c @@ -1632,7 +1632,14 @@ int phpdbg_interactive(zend_bool allow_async_unsafe, char *input) /* {{{ */ sigio_watcher_start(); } #endif - switch (ret = phpdbg_stack_execute(&stack, allow_async_unsafe)) { + zend_try { + ret = phpdbg_stack_execute(&stack, allow_async_unsafe); + } zend_catch { + phpdbg_stack_free(&stack); + zend_bailout(); + } zend_end_try(); + + switch (ret) { case FAILURE: if (!(PHPDBG_G(flags) & PHPDBG_IS_STOPPING)) { if (!allow_async_unsafe || phpdbg_call_register(&stack) == FAILURE) {