cpython/Objects
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
..
clinic
stringlib
abstract.c
boolobject.c
bytearrayobject.c
bytes_methods.c
bytesobject.c
call.c
capsule.c
cellobject.c
classobject.c
codeobject.c
complexobject.c
descrobject.c
dictnotes.txt
dictobject.c
enumobject.c
exception_handling_notes.txt
exceptions.c
fileobject.c
floatobject.c
frame_layout.md
frameobject.c
funcobject.c
genericaliasobject.c
genobject.c
interpreteridobject.c
iterobject.c
listobject.c
listsort.txt
lnotab_notes.txt
locations.md
longobject.c
memoryobject.c
methodobject.c
moduleobject.c
namespaceobject.c
object.c
object_layout.md
object_layout_312.gv
object_layout_312.png
object_layout_full_312.gv
object_layout_full_312.png
obmalloc.c
odictobject.c
picklebufobject.c
rangeobject.c
README
setobject.c
sliceobject.c
structseq.c
tupleobject.c
typeobject.c
typeslots.inc
typeslots.py
typevarobject.c
unicodectype.c
unicodeobject.c
unicodetype_db.h
unionobject.c
weakrefobject.c

Source files for various builtin objects