[3.12] gh-125682: Reject non-ASCII digits in the Python implementation of JSON decoder (GH-125687) (GH-125693)

(cherry picked from commit d358425e69)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
This commit is contained in:
Miss Islington (bot) 2024-10-21 15:06:02 +02:00 committed by GitHub
parent 2bc2aae386
commit 18196fea89
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 1 deletions

View file

@ -9,7 +9,7 @@ except ImportError:
__all__ = ['make_scanner']
NUMBER_RE = re.compile(
r'(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?',
r'(-?(?:0|[1-9][0-9]*))(\.[0-9]+)?([eE][-+]?[0-9]+)?',
(re.VERBOSE | re.MULTILINE | re.DOTALL))
def py_make_scanner(context):