Skip to content

Commit 152ccfb

Browse files
committed
Fix stack leak in phpdbg
1 parent a7bcfee commit 152ccfb

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

sapi/phpdbg/phpdbg_prompt.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1632,7 +1632,14 @@ int phpdbg_interactive(zend_bool allow_async_unsafe, char *input) /* {{{ */
16321632
sigio_watcher_start();
16331633
}
16341634
#endif
1635-
switch (ret = phpdbg_stack_execute(&stack, allow_async_unsafe)) {
1635+
zend_try {
1636+
ret = phpdbg_stack_execute(&stack, allow_async_unsafe);
1637+
} zend_catch {
1638+
phpdbg_stack_free(&stack);
1639+
zend_bailout();
1640+
} zend_end_try();
1641+
1642+
switch (ret) {
16361643
case FAILURE:
16371644
if (!(PHPDBG_G(flags) & PHPDBG_IS_STOPPING)) {
16381645
if (!allow_async_unsafe || phpdbg_call_register(&stack) == FAILURE) {

0 commit comments

Comments
 (0)