10000 bpo-40880: Fix invalid read in newline_in_string in pegen.c by pablogsal · Pull Request #20666 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-40880: Fix invalid read in newline_in_string in pegen.c #20666

8000
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 5, 2020
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
0