]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.14] gh-143003: Fix possible shared buffer overflow in `bytearray.extend()` (GH...
authorStan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Tue, 6 Jan 2026 11:48:45 +0000 (11:48 +0000)
committerGitHub <noreply@github.com>
Tue, 6 Jan 2026 11:48:45 +0000 (13:48 +0200)
commit9f91278412e30ca3daaa427614176b2891bd230a
tree9a955f76d63418e6e01d520c7d0e7f3e9e86b55c
parentc889ff6ba5ddd4c42ba0dc56a2944c4c109654ae
[3.14] gh-143003: Fix possible shared buffer overflow in `bytearray.extend()` (GH-143086) (GH-143447)

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