Skip to content
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

bpo-32758: warn that a couple ast functions can crash the interpreter #5960

Merged
merged 1 commit into from Mar 9, 2018

Conversation

brettcannon
Copy link
Member

@brettcannon brettcannon commented Mar 2, 2018

Both ast.parse() and ast.literal_eval() can trigger a segfault with the appropriate string input due to the recursion depth limit of the AST compiler.

https://bugs.python.org/issue32758

@brettcannon
Copy link
Member Author

Got approval for the wording from @serhiy-storchaka in the issue itself, but he also pointed out that there are implicit uses of the troublesome functions in various other places, so the comment needs to spread out a bit more before this PR can get merged.

@brettcannon brettcannon merged commit 7a7f100 into python:master Mar 9, 2018
@miss-islington
Copy link
Contributor

Thanks @brettcannon for the PR 🌮🎉.. I'm working now to backport this PR to: 2.7, 3.6, 3.7.
🐍🍒⛏🤖

@brettcannon brettcannon deleted the ast-warning branch March 9, 2018 20:03
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 9, 2018
…the interpreter (pythonGH-5960)

(cherry picked from commit 7a7f100)

Co-authored-by: Brett Cannon <brettcannon@users.noreply.github.com>
@bedevere-bot
Copy link

GH-6041 is a backport of this pull request to the 3.7 branch.

@miss-islington
Copy link
Contributor

Sorry, @brettcannon, I could not cleanly backport this to 2.7 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 7a7f100eb352d08938ee0f5ba59c18f56dc4a7b5 2.7

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 9, 2018
…the interpreter (pythonGH-5960)

(cherry picked from commit 7a7f100)

Co-authored-by: Brett Cannon <brettcannon@users.noreply.github.com>
@bedevere-bot
Copy link

GH-6042 is a backport of this pull request to the 3.6 branch.

brettcannon added a commit that referenced this pull request Mar 9, 2018
…the interpreter (GH-5960) (GH-6042)

(cherry picked from commit 7a7f100)

Co-authored-by: Brett Cannon <brettcannon@users.noreply.github.com>
brettcannon added a commit that referenced this pull request Mar 9, 2018
…the interpreter (GH-5960) (GH-6041)

(cherry picked from commit 7a7f100)

Co-authored-by: Brett Cannon <brettcannon@users.noreply.github.com>
jo2y pushed a commit to jo2y/cpython that referenced this pull request Mar 23, 2018
AWhetter pushed a commit to AWhetter/cpython that referenced this pull request Oct 3, 2019
…the interpreter (pythonGH-5960)

(cherry picked from commit 7a7f100)

Co-authored-by: Brett Cannon <brettcannon@users.noreply.github.com>
@bedevere-bot
Copy link

GH-16565 is a backport of this pull request to the 2.7 branch.

serhiy-storchaka pushed a commit that referenced this pull request Oct 18, 2019
…the interpreter (GH-5960) (GH-16565)

(cherry picked from commit 7a7f100)

Co-authored-by: Brett Cannon <brettcannon@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants