]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-141311: Avoid assertion in BytesIO.readinto() (GH-141333) (GH-141478)
authorCody Maloney <cmaloney@users.noreply.github.com>
Wed, 12 Nov 2025 21:37:06 +0000 (13:37 -0800)
committerGitHub <noreply@github.com>
Wed, 12 Nov 2025 21:37:06 +0000 (23:37 +0200)
commit7c62bd571bfc40237bc8120bdba80c92e35944d5
treea5efd7108f8b5483c3cf77b477882e1ebfb377fb
parentfffd38b2dd9706f4a1e3ee842441abffdf9a57b9
[3.13] gh-141311: Avoid assertion in BytesIO.readinto() (GH-141333) (GH-141478)

Fix error in assertion which causes failure if pos is equal to PY_SSIZE_T_MAX.
Fix undefined behavior in read() and readinto() if pos is larger that the size
of the underlying buffer.
(cherry picked from commit 7d54374f9c7d91e0ef90c4ad84baf10073cf1d8a)
Lib/test/test_memoryio.py
Misc/NEWS.d/next/Library/2025-11-09-18-55-13.gh-issue-141311.qZ3swc.rst [new file with mode: 0644]
Modules/_io/bytesio.c