bpo-40661: Fix segfault when parsing invalid input (GH-20165)

Fix segfaults when parsing very complex invalid input, like `import äˆ ð£„¯ð¢·žð±‹á”€ð””ð‘©±å®ä±¬ð©¾\nð—¶½`.

Co-authored-by: Guido van Rossum <guido@python.org>
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
This commit is contained in:
Lysandros Nikolaou 2020-05-18 20:32:03 +03:00 committed by GitHub
parent 08b47c367a
commit 7b7a21bc4f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 1603 additions and 8 deletions

View file

@ -659,6 +659,9 @@ Corner-cases that used to crash:
Traceback (most recent call last):
SyntaxError: cannot assign to __debug__
>>> import ä £
Traceback (most recent call last):
SyntaxError: invalid character '£' (U+00A3)
"""
import re