diff options
-rw-r--r-- | Modules/posixmodule.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index bd97f0a..44d6009 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -8410,11 +8410,7 @@ os_read_impl(PyObject *module, int fd, Py_ssize_t length) return posix_error(); } -#ifdef MS_WINDOWS - /* On Windows, the count parameter of read() is an int */ - if (length > INT_MAX) - length = INT_MAX; -#endif + length = Py_MIN(length, _PY_READ_MAX); buffer = PyBytes_FromStringAndSize((char *)NULL, length); if (buffer == NULL) |