Skip to content

Commit 10f1d04

Browse files
committed
Merge branch 'PHP-8.5'
* PHP-8.5: Fix GH-17387: crash on unterminated quote in phpdbg lexer
2 parents f785614 + d92b5f9 commit 10f1d04

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

‎sapi/phpdbg/phpdbg_lexer.l‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,13 @@ INPUT ("\\"[#"']|["]("\\\\"|"\\"["]|[^\n\000"])*["]|[']("\\"[']|"\\\\"|[^\
166166
return T_ID;
167167
}
168168
169+
<NORMAL>["'] {
170+
phpdbg_init_param(yylval, STR_PARAM);
171+
yylval->str = estrndup(yytext, yyleng);
172+
yylval->len = yyleng;
173+
return T_ID;
174+
}
175+
169176
<RAW>{INPUT} {
170177
phpdbg_init_param(yylval, STR_PARAM);
171178
yylval->str = estrdup(yytext);

‎sapi/phpdbg/tests/gh17387.phpt‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
--TEST--
2+
GH-17387 (Trivial crash in phpdbg lexer)
3+
--PHPDBG--
4+
a';
5+
q
6+
--EXPECT--
7+
prompt> [The command "a" could not be found]
8+
prompt>

0 commit comments

Comments
 (0)