]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.9] bpo-11105: Do not crash when compiling recursive ASTs (GH-20594) (GH-26522)
authorBatuhan Taskaya <batuhan@python.org>
Thu, 3 Jun 2021 21:22:34 +0000 (00:22 +0300)
committerGitHub <noreply@github.com>
Thu, 3 Jun 2021 21:22:34 +0000 (22:22 +0100)
commitde58b319af3a72440a74e807cf8a1194ed0c6d8c
tree09887cfcd1ad5428657f7747df04957dbc498b09
parent5a8ddcc4524dca3880d7fc2818814ffae1cfb8a2
[3.9] bpo-11105: Do not crash when compiling recursive ASTs (GH-20594) (GH-26522)

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..
(cherry picked from commit f3491242e41933aa9529add7102edb68b80a25e9)

Co-authored-by: Batuhan Taskaya <batuhan@python.org>
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