Fix sock_recvfrom_guts(): recvfrom() size is limited to an int on Windows, not

on other OSes!
This commit is contained in:
Victor Stinner 2013-11-16 00:18:58 +01:00
parent 3b5901143d
commit e990c6e952

View file

@ -2833,7 +2833,7 @@ sock_recvfrom_guts(PySocketSockObject *s, char* cbuf, Py_ssize_t len, int flags,
memset(&addrbuf, 0, addrlen); memset(&addrbuf, 0, addrlen);
timeout = internal_select_ex(s, 0, interval); timeout = internal_select_ex(s, 0, interval);
if (!timeout) { if (!timeout) {
#ifndef MS_WINDOWS #ifdef MS_WINDOWS
if (len > INT_MAX) if (len > INT_MAX)
len = INT_MAX; len = INT_MAX;
n = recvfrom(s->sock_fd, cbuf, (int)len, flags, n = recvfrom(s->sock_fd, cbuf, (int)len, flags,