]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-11105: Do not crash when compiling recursive ASTs (GH-20594)
authorBatuhan Taskaya <batuhan@python.org>
Thu, 3 Jun 2021 20:01:02 +0000 (23:01 +0300)
committerGitHub <noreply@github.com>
Thu, 3 Jun 2021 20:01:02 +0000 (21:01 +0100)
commitf3491242e41933aa9529add7102edb68b80a25e9
treecc4331ec55371585163e5db0291d6c17a765eca7
parentf461a7fc3f8740b9e79e8874175115a3474e5930
bpo-11105: Do not crash when compiling recursive ASTs (GH-20594)

When compiling an AST object with a direct / indirect reference
cycles, on the conversion phase because of exceeding amount of
calls, a segfault was raised. This patch adds recursion guards to
places for preventing user inputs to not to crash AST but instead
raise a RecursionError.
Lib/test/test_ast.py
Misc/NEWS.d/next/Core and Builtins/2020-06-02-13-21-14.bpo-11105.wceryW.rst [new file with mode: 0644]
Parser/asdl_c.py
Python/Python-ast.c