]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.14] gh-141311: Avoid assertion in BytesIO.readinto() (GH-141333) (GH-141457)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 12 Nov 2025 10:23:26 +0000 (11:23 +0100)
committerGitHub <noreply@github.com>
Wed, 12 Nov 2025 10:23:26 +0000 (10:23 +0000)
commit75b5157e846a7d65eace108b9d234dfd6115735f
treeb02a4720ed51eb3cd15ce01949865e95a49cd681
parentb883ad17cd1d6cc9464299c951bb779e88339775
[3.14] gh-141311: Avoid assertion in BytesIO.readinto() (GH-141333) (GH-141457)

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)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
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