Skip to content

Commit 09d0f96

Browse files
committed
Partially fix GH-17387
The length of the string should be set to the truncated length (that was used to duplicate the input anyway).
1 parent 333f5dd commit 09d0f96

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sapi/phpdbg/phpdbg_lexer.l

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,9 @@ INPUT ("\\"[#"']|["]("\\\\"|"\\"["]|[^\n\000"])*["]|[']("\\"[']|"\\\\"|[^\
160160
161161
<NORMAL>{GENERIC_ID} {
162162
phpdbg_init_param(yylval, STR_PARAM);
163-
yylval->str = estrndup(yytext, yyleng - unescape_string(yytext));
164-
yylval->len = yyleng;
163+
size_t len = yyleng - unescape_string(yytext);
164+
yylval->str = estrndup(yytext, len);
165+
yylval->len = len;
165166
return T_ID;
166167
}
167168

0 commit comments

Comments
 (0)