cpython/Include/cpython
Serhiy Storchaka 4398b788ff
[3.12] gh-133767: Fix use-after-free in the unicode-escape decoder with an error handler (GH-129648) (GH-133944) (#134337)
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)
2025-05-25 20:33:22 -07:00
..
abstract.h gh-98586: Add vector call APIs to the Limited API (GH-98587) 2022-10-27 11:45:42 +02:00
bytearrayobject.h gh-89653: PEP 670: Macros always cast arguments in cpython/ (#93766) 2022-06-13 20:09:40 +02:00
bytesobject.h [3.12] gh-133767: Fix use-after-free in the unicode-escape decoder with an error handler (GH-129648) (GH-133944) (#134337) 2025-05-25 20:33:22 -07:00
cellobject.h
ceval.h [3.12] gh-104812: Run Pending Calls in any Thread (gh-104813) (gh-105752) 2023-06-14 00:50:08 +00:00
classobject.h gh-89653: PEP 670: Convert macros to functions (#99843) 2022-11-28 16:40:08 +01:00
code.h [3.12] gh-116767: fix crash on 'async with' with many context managers (GH-118348) (#118477) 2024-05-01 18:23:29 +01:00
compile.h gh-98811: use full source location to simplify __future__ imports error checking. This also fixes an incorrect error offset. (GH-98812) 2022-10-31 13:08:03 +00:00
complexobject.h
context.h
descrobject.h
dictobject.h gh-102381: don't call watcher callback with dead object (#102382) 2023-03-07 17:10:58 -07:00
fileobject.h
fileutils.h
floatobject.h gh-89653: PEP 670: Convert macros to functions (#99843) 2022-11-28 16:40:08 +01:00
frameobject.h [3.12] GH-96803: Move PyUnstable_InterpreterFrame_GetCode() to Python.h (GH-107188) (#107195) 2023-07-24 19:54:42 +00:00
funcobject.h [3.12] gh-118207: Rename the COMMON_FIELDS macro in funcobject.h and undef it after use (GH-118208) (#118269) 2024-04-25 22:29:45 -07:00
genobject.h GH-102181: Improve specialization stats for SEND (GH-102182) 2023-05-10 22:40:59 +00:00
import.h gh-100227: Isolate the Import State to Each Interpreter (gh-101941) 2023-03-09 09:46:21 -07:00
initconfig.h [3.12] gh-98608: Move PyInterpreterConfig to pylifecycle.h (GH-107191) (#107198) 2023-07-24 20:13:07 +00:00
interpreteridobject.h [3.12] gh-101524: Only Use Public C-API in the _xxsubinterpreters Module (gh-105258) (gh-107303) 2023-07-27 13:15:47 -06:00
listobject.h
longintrepr.h [3.12] gh-116869: Make C API compatible with ISO C90 (GH-116950) (#117011) 2024-03-19 16:06:15 +00:00
longobject.h GH-101291: Add low level, unstable API for pylong (GH-101685) 2023-05-21 14:45:48 +01:00
memoryobject.h gh-104223: Fix issues with inheriting from buffer classes (#104227) 2023-05-08 09:52:41 -07:00
methodobject.h
modsupport.h [3.12] gh-86493: Fix possible leaks in some modules initialization (GH-106768) (GH-106855) 2023-07-18 15:14:10 +03:00
object.h [3.12] gh-91051: fix segfault when using all 8 type watchers (GH-107853) (#107876) 2023-08-16 11:58:54 +02:00
objimpl.h gh-103743: Add PyUnstable_Object_GC_NewWithExtraData (GH-103744) 2023-05-02 13:38:46 +02:00
odictobject.h gh-87347: Add parenthesis around macro arguments (#93915) 2022-06-20 16:04:52 +02:00
picklebufobject.h
pthread_stubs.h
pyctype.h
pydebug.h
pyerrors.h [3.12] gh-105071: add PyUnstable_Exc_PrepReraiseStar to expose except* implementation in the unstable API (GH-105072) (#105095) 2023-05-30 16:50:23 +01:00
pyfpe.h
pyframe.h [3.12] GH-96803: Move PyUnstable_InterpreterFrame_GetCode() to Python.h (GH-107188) (#107195) 2023-07-24 19:54:42 +00:00
pylifecycle.h [3.12] gh-98608: Move PyInterpreterConfig to pylifecycle.h (GH-107191) (#107198) 2023-07-24 20:13:07 +00:00
pymem.h
pystate.h [3.12] GH-112215: Backport C recursion changes (GH-115083) 2024-02-13 10:45:59 +01:00
pythonrun.h
pythread.h [3.12] gh-129296: Fix pythread.h include paths (#129320) (#130668) 2025-02-28 08:19:50 +00:00
pytime.h [3.12] gh-127906: Declare timeval struct in pytime.h on Windows (#127908) 2024-12-13 12:13:49 +00:00
setobject.h gh-89653: PEP 670: Convert macros to functions (#99843) 2022-11-28 16:40:08 +01:00
sysmodule.h
traceback.h
tupleobject.h
unicodeobject.h [3.12] gh-133767: Fix use-after-free in the unicode-escape decoder with an error handler (GH-129648) (GH-133944) (#134337) 2025-05-25 20:33:22 -07:00
warnings.h
weakrefobject.h