Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upbpo-36367: Free buffer if realloc fails in tokenize.c #12442
Conversation
the-knights-who-say-ni
added
the
CLA signed
label
Mar 19, 2019
bedevere-bot
added
the
awaiting merge
label
Mar 19, 2019
pablogsal
added
the
skip news
label
Mar 19, 2019
pablogsal
force-pushed the
pablogsal:bpo36367
branch
2 times, most recently
from
9c036e5
to
dce2421
Mar 19, 2019
matrixise
approved these changes
Mar 19, 2019
I had the same solution, seems to be fine for me. |
bedevere-bot
added
awaiting core review
and removed
awaiting merge
labels
Mar 19, 2019
remilapeyre
suggested changes
Mar 19, 2019
Hi @pablogsal I think there is the same issue in Line 891 in dce2421 I think the cast to |
This comment has been minimized.
This comment has been minimized.
As far as I can tell this issue is also present on Line 963 in dce2421 |
vstinner
reviewed
Mar 19, 2019
@@ -618,7 +618,7 @@ static char * | |||
translate_newlines(const char *s, int exec_input, struct tok_state *tok) { | |||
int skip_next_lf = 0; | |||
size_t needed_length = strlen(s) + 2, final_length; | |||
char *buf, *current; | |||
char *buf, *current, *result; |
This comment has been minimized.
This comment has been minimized.
vstinner
Mar 19, 2019
Member
Can you move result declaration where it's used? Python 3.8 now allows C99 ;-) (see PEP 7)
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@remilapeyre I think for Line 891 in dce2421 Lines 893 to 899 in dce2421 |
pablogsal
force-pushed the
pablogsal:bpo36367
branch
from
dce2421
to
aeba989
Mar 19, 2019
pablogsal
force-pushed the
pablogsal:bpo36367
branch
from
aeba989
to
0650c4e
Mar 19, 2019
remilapeyre
approved these changes
Mar 19, 2019
@pablogsal Yes it is, I think you patch is correct now. |
pablogsal
merged commit cb90c89
into
python:master
Mar 19, 2019
pablogsal
deleted the
pablogsal:bpo36367
branch
Mar 19, 2019
bedevere-bot
removed
the
awaiting core review
label
Mar 19, 2019
vstinner
added
needs backport to 2.7
needs backport to 3.7
labels
Mar 20, 2019
This comment has been minimized.
This comment has been minimized.
miss-islington
commented
Mar 20, 2019
Thanks @pablogsal for the PR |
This comment has been minimized.
This comment has been minimized.
miss-islington
commented
Mar 20, 2019
Thanks @pablogsal for the PR |
added a commit
to vstinner/cpython
that referenced
this pull request
Mar 20, 2019
bedevere-bot
removed
the
needs backport to 2.7
label
Mar 20, 2019
This comment has been minimized.
This comment has been minimized.
bedevere-bot
commented
Mar 20, 2019
GH-12470 is a backport of this pull request to the 2.7 branch. |
added a commit
to vstinner/cpython
that referenced
this pull request
Mar 20, 2019
bedevere-bot
removed
the
needs backport to 3.7
label
Mar 20, 2019
This comment has been minimized.
This comment has been minimized.
bedevere-bot
commented
Mar 20, 2019
GH-12471 is a backport of this pull request to the 3.7 branch. |
pablogsal commentedMar 19, 2019
•
edited by bedevere-bot
https://bugs.python.org/issue36367