Merge pull request #15941 from s-hadinger/berry_fix_lexer_unfinished_strings

Berry fix potential crash when parsing unfinished strings
This commit is contained in:
Theo Arends 2022-07-07 13:34:32 +02:00 committed by GitHub
commit c6e6dfe852
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -419,6 +419,9 @@ static btokentype scan_string(blexer *lexer)
save(lexer); /* skip '\\.' */
}
}
if (c == EOS) {
be_lexerror(lexer, "unfinished string");
}
c = next(lexer); /* skip '"' or '\'' */
/* check if there's an additional string literal right after */
skip_delimiter(lexer);