cpython/Modules/_io
Cody Maloney a1a71efa6e
[3.13] gh-140607: Validate returned byte count in RawIOBase.read (GH-140611) (#140730)
* [3.13] gh-140607: Validate returned byte count in RawIOBase.read (GH-140611)

While `RawIOBase.readinto` should return a count of bytes between 0 and
the length of the given buffer, it is not required to. Add validation
inside RawIOBase.read() that the returned byte count is valid.
(cherry picked from commit 0f0a362768)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
Co-authored-by: Shamil <ashm.tech@proton.me>
Co-authored-by: Victor Stinner <vstinner@python.org>

* fixup: Use older attribute name

---------

Co-authored-by: Shamil <ashm.tech@proton.me>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-10-29 13:31:57 +01:00
..
clinic [3.13] gh-128083: Fix macro redefinition warning in clinic. (GH-127950) (#128102) 2024-12-19 21:29:14 +00:00
_iomodule.c gh-116322: Add Py_mod_gil module slot (#116882) 2024-05-03 11:30:55 -04:00
_iomodule.h gh-101819: Isolate _io (#101948) 2023-05-15 09:26:27 +00:00
bufferedio.c [3.13] gh-135607: remove null checking of weakref list in dealloc of extension modules and objects (#135614) (#136126) 2025-07-01 11:26:52 +02:00
bytesio.c [3.13] gh-135607: remove null checking of weakref list in dealloc of extension modules and objects (#135614) (#136126) 2025-07-01 11:26:52 +02:00
fileio.c [3.13] gh-135607: remove null checking of weakref list in dealloc of extension modules and objects (#135614) (#136126) 2025-07-01 11:26:52 +02:00
iobase.c [3.13] gh-140607: Validate returned byte count in RawIOBase.read (GH-140611) (#140730) 2025-10-29 13:31:57 +01:00
stringio.c [3.13] gh-135607: remove null checking of weakref list in dealloc of extension modules and objects (#135614) (#136126) 2025-07-01 11:26:52 +02:00
textio.c [3.13] gh-135607: remove null checking of weakref list in dealloc of extension modules and objects (#135614) (#136126) 2025-07-01 11:26:52 +02:00
winconsoleio.c [3.13] gh-135607: remove null checking of weakref list in dealloc of extension modules and objects (#135614) (#136126) 2025-07-01 11:26:52 +02:00