summaryrefslogtreecommitdiffstats
path: root/Modules/_ssl.c
diff options
context:
space:
mode:
authorCharles-François Natali <neologix@free.fr>2011-08-28 14:22:33 (GMT)
committerCharles-François Natali <neologix@free.fr>2011-08-28 14:22:33 (GMT)
commitfda7b379acde3ad60bbd42acb6da7e7099d25133 (patch)
tree8a6f41e799670ac5cea353e6cc4bc671fec25798 /Modules/_ssl.c
parentbbabbae114f6d16dacdc1ad8f6f04b95fb6b17eb (diff)
downloadcpython-fda7b379acde3ad60bbd42acb6da7e7099d25133.zip
cpython-fda7b379acde3ad60bbd42acb6da7e7099d25133.tar.gz
cpython-fda7b379acde3ad60bbd42acb6da7e7099d25133.tar.bz2
Issue #12287: Fix a stack corruption in ossaudiodev module when the FD is
greater than FD_SETSIZE.
Diffstat (limited to 'Modules/_ssl.c')
-rw-r--r--Modules/_ssl.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
index 5af5bde..80b661f 100644
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -1145,10 +1145,8 @@ check_socket_and_wait_for_timeout(PySocketSockObject *s, int writing)
#endif
/* Guard against socket too large for select*/
-#ifndef Py_SOCKET_FD_CAN_BE_GE_FD_SETSIZE
- if (s->sock_fd >= FD_SETSIZE)
+ if (!_PyIsSelectable_fd(s->sock_fd))
return SOCKET_TOO_LARGE_FOR_SELECT;
-#endif
/* Construct the arguments to select */
tv.tv_sec = (int)s->sock_timeout;