In _io_BytesIO_readinto_impl() len value is used in memcpy and then checked for being positive. It's better to move assertions before memcpy. This may be done with the following commit: https://github.com/python/cpython/commit/da720c10f6d841737195ca49440a038ae29bc9b9 <!-- gh-linked-prs --> ### Linked PRs * gh-131536 * gh-134239 <!-- /gh-linked-prs -->
In _io_BytesIO_readinto_impl() len value is used in memcpy and then checked for being positive.
It's better to move assertions before memcpy.
This may be done with the following commit: da720c1
Linked PRs