]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-141311: Avoid assertion in BytesIO.readinto() (GH-141333)
authorCody Maloney <cmaloney@users.noreply.github.com>
Wed, 12 Nov 2025 09:57:05 +0000 (01:57 -0800)
committerGitHub <noreply@github.com>
Wed, 12 Nov 2025 09:57:05 +0000 (11:57 +0200)
commit7d54374f9c7d91e0ef90c4ad84baf10073cf1d8a
tree3b87e4c56b14ed643f5ad61afb5177ba75813de6
parent20f53df07d42c495a08c73a3d54b8dd9098a62f0
gh-141311: Avoid assertion in BytesIO.readinto() (GH-141333)

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.
Lib/test/test_io/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