bpo-36367: Free buffer if realloc fails in tokenize.c#12442
bpo-36367: Free buffer if realloc fails in tokenize.c#12442pablogsal merged 1 commit intopython:masterfrom
Conversation
9c036e5 to
dce2421
Compare
matrixise
left a comment
There was a problem hiding this comment.
I had the same solution, seems to be fine for me.
remilapeyre
left a comment
There was a problem hiding this comment.
Hi @pablogsal I think there is the same issue in https://github.com/python/cpython/blob/dce242187f25b6861b08fe5d7e581efcfc49ea21/Parser/tokenizer.c#L891. Can you fix it too?
I think the cast to char * there is also not needed.
|
As far as I can tell this issue is also present on https://github.com/python/cpython/blob/dce242187f25b6861b08fe5d7e581efcfc49ea21/Parser/tokenizer.c#L963 |
Parser/tokenizer.c
Outdated
There was a problem hiding this comment.
Can you move result declaration where it's used? Python 3.8 now allows C99 ;-) (see PEP 7)
|
@remilapeyre I think for https://github.com/python/cpython/blob/dce242187f25b6861b08fe5d7e581efcfc49ea21/Parser/tokenizer.c#L891 is not a problem as is handle correctly afterwards: |
remilapeyre
left a comment
There was a problem hiding this comment.
@pablogsal Yes it is, I think you patch is correct now.
|
Thanks @pablogsal for the PR 🌮🎉.. I'm working now to backport this PR to: 2.7. |
|
Thanks @pablogsal for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7. |
|
GH-12470 is a backport of this pull request to the 2.7 branch. |
|
GH-12471 is a backport of this pull request to the 3.7 branch. |
https://bugs.python.org/issue36367