cpython/Objects
Miss Islington (bot) 8160453a18
[3.15] gh-158928: Fix overflow in bytearray.__init__ from an iterator (GH-158947) (#161448)
Passing an iterator to `bytearray.__init__` didn't take into account
that iterating that iterator could modify the bytearray position and
`ob_start`. When that happened the iterator would write beyond the end
of the allocation.

Update the "enough space" check to account for `ob_start`. The
assignment always included it. Add an assert after append that the
offsets line up as expected.
(cherry picked from commit 25181cee14)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-05 14:14:18 -08:00
..
clinic
mimalloc [3.15] gh-160588: Restore the gh-123022 check in the vendored mimalloc (GH-160589) (#160611) 2026-10-24 18:20:18 +00:00
stringlib
abstract.c
boolobject.c
bytearrayobject.c [3.15] gh-158928: Fix overflow in bytearray.__init__ from an iterator (GH-158947) (#161448) 2026-11-05 14:14:18 -08:00
bytes_methods.c
bytesobject.c
call.c
capsule.c
cellobject.c
classobject.c
codeobject.c [3.15] gh-159184: Do not intern NaN constants on the free-threaded build (GH-161276) (#161287) 2026-11-05 14:04:36 -08:00
complexobject.c
descrobject.c
dictnotes.txt
dictobject.c [3.15] gh-160496: Clear inline values with atomic release stores (GH-160510) (#160710) 2026-10-26 14:50:22 +00:00
enumobject.c
exceptions.c [3.15] gh-160773: Fix use-after-free in OSError.__str__ (GH-160822) (#160884) 2026-10-29 11:59:21 +00:00
fileobject.c
floatobject.c
frameobject.c
funcobject.c [3.15] gh-159136: Avoid stop-the-world when setting function name attributes (gh-159269) (gh-159725) 2026-10-29 15:17:50 -07:00
genericaliasobject.c
genobject.c [3.15] gh-159136: Avoid stop-the-world when setting function name attributes (gh-159269) (gh-159725) 2026-10-29 15:17:50 -07:00
interpolationobject.c
iterobject.c
lazyimportobject.c
listobject.c [3.15] gh-159739: Protect list storage while reporting its size (GH-160196) (#160363) 2026-10-22 23:59:28 +00:00
listsort.txt
longobject.c
memoryobject.c gh-149402: Don't assume single-character type codes (struct/array/ctypes) (GH-149483) 2026-11-04 12:11:08 +09:00
methodobject.c
moduleobject.c
namespaceobject.c
object.c
object_layout.md
object_layout_312.gv
object_layout_312.png
object_layout_313.gv
object_layout_313.png
object_layout_full_312.gv
object_layout_full_312.png
object_layout_full_313.gv
object_layout_full_313.png
obmalloc.c
odictobject.c
picklebufobject.c
rangeobject.c
README
sentinelobject.c
setobject.c
sliceobject.c
structseq.c
templateobject.c
tupleobject.c
typeobject.c
typevarobject.c
unicode_format.c
unicode_formatter.c
unicode_writer.c
unicodectype.c
unicodeobject.c
unicodetype_db.h
unionobject.c
weakrefobject.c

Source files for various builtin objects