cpython/Parser
Serhiy Storchaka 73b3040f59
[3.11] gh-133767: Fix use-after-free in the unicode-escape decoder with an error handler (GH-129648) (GH-133944) (GH-134341)
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)
(cherry picked from commit 6279eb8c07)
(cherry picked from commit a75953b347)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-06-02 17:52:52 +02:00
..
action_helpers.c bpo-47212: Improve error messages for un-parenthesized generator expressions (GH-32302) 2022-04-05 14:47:13 +01: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.11] gh-106905: Use separate structs to track recursion depth in each PyAST_mod2obj call. (GH-113035) (GH-113472) (GH-113476) 2023-12-25 20:40:33 +00:00
myreadline.c bpo-45434: Move _Py_BEGIN_SUPPRESS_IPH to pycore_fileutils.h (GH-28922) 2021-10-13 15:03:35 +02:00
parser.c [3.11] gh-109120: Fix syntax error in handlinh of incorrect star expressions… (#117464) 2024-04-03 11:37:39 +01:00
peg_api.c bpo-43244: Remove parser_interface.h header file (GH-25001) 2021-03-24 01:29:09 +01:00
pegen.c [3.11] bpo-43950: handle wide unicode characters in tracebacks (GH-28150) (#111373) 2023-10-27 09:46:20 +09:00
pegen.h [3.11] bpo-43950: handle wide unicode characters in tracebacks (GH-28150) (#111373) 2023-10-27 09:46:20 +09:00
pegen_errors.c [3.11] gh-115823: Calculate correctly error locations when dealing with implicit encodings (GH-115824) (#115950) 2024-02-26 16:08:37 +00:00
Python.asdl bpo-46289: Make conversion of FormattedValue not optional on ASDL (GH-30467) 2022-01-07 13:05:28 -08:00
string_parser.c [3.11] gh-133767: Fix use-after-free in the unicode-escape decoder with an error handler (GH-129648) (GH-133944) (GH-134341) 2025-06-02 17:52:52 +02:00
string_parser.h bpo-43244: Remove ast.h, asdl.h, Python-ast.h headers (GH-24933) 2021-03-23 20:47:40 +01:00
token.c bpo-43822: Improve syntax errors for missing commas (GH-25377) 2021-04-15 21:38:45 +01:00
tokenizer.c [3.11] gh-107450: Check for overflow in the tokenizer and fix overflow test (GH-110832) (#110939) 2023-10-18 00:34:56 +02:00
tokenizer.h [3.11] Fix typo in the tokenizer (GH-104950) (#104952) 2023-05-25 23:32:04 -07:00