Skip to content

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

Merged
brettcannon merged 1 commit into
python:masterfrom
brettcannon:ast-warning
Mar 9, 2018
Merged

bpo-32758: warn that a couple ast functions can crash the interpreter#5960
brettcannon merged 1 commit into
python:masterfrom
brettcannon:ast-warning

Conversation

@brettcannon
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown

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

@miss-islington
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown

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.

4 participants