Skip to content

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 <[email protected]>
@bedevere-bot
Copy link

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 <[email protected]>
@bedevere-bot
Copy link

3.6 branch.

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

(cherry picked from commit 7a7f100)

Co-authored-by: Brett Cannon <[email protected]>
brettcannon added a commit that referenced this pull request Mar 9, 2018
…the interpreter (GH-6041)

(cherry picked from commit 7a7f100)

Co-authored-by: Brett Cannon <[email protected]>
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 <[email protected]>
@bedevere-bot
Copy link

2.7 branch.

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

(cherry picked from commit 7a7f100)

Co-authored-by: Brett Cannon <[email protected]>
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

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant