From 152ccfb08dd766cdb76583b061dcc2c8a73a7255 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 21 Jun 2019 16:52:08 +0200 Subject: Fix stack leak in phpdbg --- sapi/phpdbg/phpdbg_prompt.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'sapi/phpdbg/phpdbg_prompt.c') 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) { -- cgit v1.2.1