Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix invalid memory read in the new parser when checking newlines in string
literals. Patch by Pablo Galindo.
4 changes: 2 additions & 2 deletions Parser/pegen/pegen.c
Original file line number Diff line number Diff line change
Expand Up @@ -937,8 +937,8 @@ _PyPegen_number_token(Parser *p)
static int // bool
newline_in_string(Parser *p, const char *cur)
{
for (char c = *cur; cur >= p->tok->buf; c = *--cur) {
if (c == '\'' || c == '"') {
for (const char *c = cur; c >= p->tok->buf; c--) {
if (*c == '\'' || *c == '"') {
return 1;
}
}
Expand Down