cpython/Parser
Serhiy Storchaka 6279eb8c07
[3.13] gh-133767: Fix use-after-free in the unicode-escape decoder with an error handler (GH-129648) (GH-133944)
If the error handler is used, a new bytes object is created to set as
the object attribute of UnicodeDecodeError, and that bytes object then
replaces the original data. A pointer to the decoded data will became invalid
after destroying that temporary bytes object. So we need other way to return
the first invalid escape from _PyUnicode_DecodeUnicodeEscapeInternal().

_PyBytes_DecodeEscape() does not have such issue, because it does not
use the error handlers registry, but it should be changed for compatibility
with _PyUnicode_DecodeUnicodeEscapeInternal().
(cherry picked from commit 9f69a58623)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-20 14:46:57 +02:00
..
lexer [3.13] gh-132769: Refactor possible read-out-of-bounds in `lexer.c` (GH-132770) (#132788) 2025-04-21 22:42:55 +00:00
tokenizer GH-110749: fix unistd.h import in file_tokenizer.c (#110750) 2023-10-12 07:52:13 +02:00
Python.asdl gh-116126: Implement PEP 696 (#116129) 2024-05-03 06:17:32 -07:00
action_helpers.c [3.13] gh-125331: Allow the parser to activate future imports on the fly (GH-125482) (#131062) 2025-03-10 22:20:38 +00:00
asdl.py bpo-43651: PEP 597: Fix EncodingWarning in some tests (GH-25142) 2021-04-02 12:53:46 +09:00
asdl_c.py [3.13] gh-126105: Fix crash in `ast` module, when `._fields` is deleted (GH-126115) (#126130) 2024-10-29 16:07:32 +00:00
myreadline.c [3.13] gh-123321: Make Parser/myreadline.c locking safe in free-threaded build (GH-123690) (#123798) 2024-09-06 22:55:42 +02:00
parser.c [3.13] gh-125331: Allow the parser to activate future imports on the fly (GH-125482) (#131062) 2025-03-10 22:20:38 +00:00
peg_api.c gh-110805: Allow the repl to show source code and complete tracebacks (#110775) 2023-10-13 09:25:37 +00:00
pegen.c [3.13] gh-133516: Raise `ValueError` when constants `True`, `False` or `None` are used as an identifier after NFKC normalization (GH-133523) (#133615) 2025-05-08 12:18:26 +01:00
pegen.h [3.13] gh-125331: Allow the parser to activate future imports on the fly (GH-125482) (#131062) 2025-03-10 22:20:38 +00:00
pegen_errors.c [3.13] gh-116042: Fix location for SyntaxErrors of invalid escapes in the tokenizer (GH-116049) (#130066) 2025-02-13 01:49:25 +00:00
string_parser.c [3.13] gh-133767: Fix use-after-free in the unicode-escape decoder with an error handler (GH-129648) (GH-133944) 2025-05-20 14:46:57 +02:00
string_parser.h gh-102856: Initial implementation of PEP 701 (#102855) 2023-04-19 11:18:16 -05:00
token.c gh-107015: Remove async_hacks from the tokenizer (#107018) 2023-07-26 16:34:15 +01:00