]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-24658: os.read() reuses _PY_READ_MAX (GH-10657)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 22 Nov 2018 14:17:34 +0000 (06:17 -0800)
committerGitHub <noreply@github.com>
Thu, 22 Nov 2018 14:17:34 +0000 (06:17 -0800)
commit18f3327d9a99163a658697465eb00c31f86535eb
tree31580d810447f0da0c5c8039c4f5f00c28f79e96
parentdf6374e15aadff7eb547fc210c0f4f28bbff7010
bpo-24658: os.read() reuses _PY_READ_MAX (GH-10657)

os_read_impl() now also truncates the size to _PY_READ_MAX
on macOS, to avoid to allocate a larger buffer even if _Py_read() is
limited to _PY_READ_MAX bytes (ex: INT_MAX on macOS).
(cherry picked from commit 9a0d7a7648547ffb77144bf2480155f6d7940dea)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
Modules/posixmodule.c