summaryrefslogtreecommitdiffstats
path: root/Modules/selectmodule.c
diff options
context:
space:
mode:
authorCharles-François Natali <neologix@free.fr>2011-08-28 15:51:43 (GMT)
committerCharles-François Natali <neologix@free.fr>2011-08-28 15:51:43 (GMT)
commitaa26b275034c07784c4d64e9a2bc26c742577327 (patch)
treed331c0e5f2dd0fc0f754ffebaf9ebb9e5c4f7958 /Modules/selectmodule.c
parent524148ad7a3e5420abf867b1e30017b5ca2311a4 (diff)
downloadcpython-aa26b275034c07784c4d64e9a2bc26c742577327.zip
cpython-aa26b275034c07784c4d64e9a2bc26c742577327.tar.gz
cpython-aa26b275034c07784c4d64e9a2bc26c742577327.tar.bz2
Issue #12287: Fix a stack corruption in ossaudiodev module when the FD is
greater than FD_SETSIZE.
Diffstat (limited to 'Modules/selectmodule.c')
-rw-r--r--Modules/selectmodule.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c
index 1285e65..2452a65 100644
--- a/Modules/selectmodule.c
+++ b/Modules/selectmodule.c
@@ -110,7 +110,7 @@ seq2set(PyObject *seq, fd_set *set, pylist fd2obj[FD_SETSIZE + 1])
#if defined(_MSC_VER)
max = 0; /* not used for Win32 */
#else /* !_MSC_VER */
- if (v < 0 || v >= FD_SETSIZE) {
+ if (!_PyIsSelectable_fd(v)) {
PyErr_SetString(PyExc_ValueError,
"filedescriptor out of range in select()");
goto finally;
@@ -160,13 +160,6 @@ set2list(fd_set *set, pylist fd2obj[FD_SETSIZE + 1])
for (j = 0; fd2obj[j].sentinel >= 0; j++) {
fd = fd2obj[j].fd;
if (FD_ISSET(fd, set)) {
-#ifndef _MSC_VER
- if (fd > FD_SETSIZE) {
- PyErr_SetString(PyExc_SystemError,
- "filedescriptor out of range returned in select()");
- goto finally;
- }
-#endif
o = fd2obj[j].obj;
fd2obj[j].obj = NULL;
/* transfer ownership */