◐ Shell
clean mode source ↗

gh-141713: Prevent possible memory denial of service when reading by serhiy-storchaka · Pull Request #142022 · python/cpython

Make read() and similar methods that read a given number of bytes use
a progressively growing buffer instead of allocating the maximum size buffer
at once.  This helps prevent certain kind of memory denial of service issues
when the number of bytes to read within a specific protocol or format is
received from untrusted source.

@serhiy-storchaka

This was referenced

Jun 11, 2026