{{ message }}
[3.6] bpo-31852: Fix segfault caused by using the async soft keyword#4122
Merged
vstinner merged 4 commits intoOct 31, 2017
Merged
[3.6] bpo-31852: Fix segfault caused by using the async soft keyword#4122vstinner merged 4 commits into
vstinner merged 4 commits into
Conversation
vstinner
reviewed
Oct 26, 2017
Member
Author
|
Should I add a NEWS entry? |
Sorry, something went wrong.
Member
|
Yes, please add a NEWS entry. You should use the blurb tool.
|
Sorry, something went wrong.
Member
Author
|
Added in e5b1993 |
Sorry, something went wrong.
1st1
approved these changes
Oct 30, 2017
1st1
left a comment
Member
There was a problem hiding this comment.
I think this is an OK fix. Let's merge it.
Sorry, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.
This PR solves a segmentation fault in Python 3.6 caused by a combination of the async soft keyword and continuation lines. Steps to reproduce:
As @Haypo mentioned in the issue you can use this file to use the issue in the tokenizer to induce a buffer overflow. This PR solves this issue as well.
The current implementation checks if the current token is
ASYNCand sets a sentient value (2) in thetok->async_defbefore looking for the token ahead (which is the step where the segfault happens). The value oftok->async_defgets overwritten after the lookahead by the usual value (1). As this particular issues are fixed by #1669 in the current master (3.7) this PR acts as a mere patch.https://bugs.python.org/issue31852