bpo-11105: Do not crash when compiling recursive ASTs by isidentical · Pull Request #20594 · python/cpython

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.

@isidentical

@isidentical

@isidentical isidentical changed the title bpo-11105: Do not crash when compiling recursive AST bpo-11105: Do not crash when compiling recursive ASTs

May 9, 2021

pablogsal

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request

Jun 3, 2021
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 f349124)

Co-authored-by: Batuhan Taskaya <batuhan@python.org>

miss-islington added a commit that referenced this pull request

Jun 3, 2021
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 f349124)

Co-authored-by: Batuhan Taskaya <batuhan@python.org>

isidentical added a commit to isidentical/cpython that referenced this pull request

Jun 3, 2021
…-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..
(cherry picked from commit f349124)

Co-authored-by: Batuhan Taskaya <batuhan@python.org>

pablogsal pushed a commit that referenced this pull request

Jun 3, 2021
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 f349124)

Co-authored-by: Batuhan Taskaya <batuhan@python.org>