Skip to content

Commit e5a723e

Browse files
committed
Avoid goto into zend_try block in do_cli()
We must not jump into a zend_try block because that skips setting up of EG(bailout), which will deref null when trying to bailout. In practice, this bug is impossible to trigger, given php_execute_script() already guards against bailout. Fixes GH-21420
1 parent 5375e97 commit e5a723e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sapi/cli/php_cli.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -867,8 +867,10 @@ static int do_cli(int argc, char **argv) /* {{{ */
867867
fprintf(stdout, "Executing for the first time...\n");
868868
fflush(stdout);
869869
}
870+
} zend_end_try();
870871

871872
do_repeat:
873+
zend_try {
872874
/* only set script_file if not set already and not in direct mode and not at end of parameter list */
873875
if (argc > php_optind
874876
&& !script_file

0 commit comments

Comments
 (0)