]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-143003: Fix possible shared buffer overflow in bytearray.extend() (GH-14308...
authorStan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Tue, 6 Jan 2026 11:49:31 +0000 (11:49 +0000)
committerGitHub <noreply@github.com>
Tue, 6 Jan 2026 11:49:31 +0000 (13:49 +0200)
commite0e255e244dd16fbb4dd38bb40f2055d518dce15
tree6c2f44033603003096fc79744b825d73ec0a003b
parent44bdb833d11688524322c4c832e3552adb1aeb3b
[3.13] gh-143003: Fix possible shared buffer overflow in bytearray.extend() (GH-143086) (GH-143448)

When __length_hint__() returns 0 for non-empty iterator, the data can be
written past the shared 0-terminated buffer, corrupting it.
(cherry picked from commit 522563549a49d28e763635c58274a23a6055f041)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Lib/test/test_bytes.py
Misc/NEWS.d/next/Core and Builtins/2025-12-23-00-13-02.gh-issue-143003.92g5qW.rst [new file with mode: 0644]
Objects/bytearrayobject.c