Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions Modules/posixmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -8021,11 +8021,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)
Expand Down