Issues caused by reading arbitrary number of bytes
Open
@serhiy-storchaka is already working on this.
Since Nov 18, 2025.
extension-modules
interpreter-core
topic-IO
type-bug
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
This is a meta-issue for a group of similar issues that have the same root cause: reading a number of bytes when the number is specified by the user/external source. Since read(n) is usually implemented by allocating a buffer of size n and then reading into it, this can cause arbitrary memory consumption which leads to swapping.
Linked PRs
- gh-142022
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.