diff options
author | Charles-François Natali <neologix@free.fr> | 2011-08-28 16:10:27 (GMT) |
---|---|---|
committer | Charles-François Natali <neologix@free.fr> | 2011-08-28 16:10:27 (GMT) |
commit | ac7e9e058d8da18d0002f2b9456900c34a13e463 (patch) | |
tree | 8b3729f41abc4afd6e0c682f01f6d80b3a09604c /Modules/ossaudiodev.c | |
parent | 44c6ef50af9980f33f6373440f0afc9cfa800c86 (diff) | |
parent | aa26b275034c07784c4d64e9a2bc26c742577327 (diff) | |
download | cpython-ac7e9e058d8da18d0002f2b9456900c34a13e463.zip cpython-ac7e9e058d8da18d0002f2b9456900c34a13e463.tar.gz cpython-ac7e9e058d8da18d0002f2b9456900c34a13e463.tar.bz2 |
Issue #12287: Fix a stack corruption in ossaudiodev module when the FD is
greater than FD_SETSIZE.
Diffstat (limited to 'Modules/ossaudiodev.c')
-rw-r--r-- | Modules/ossaudiodev.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/ossaudiodev.c b/Modules/ossaudiodev.c index 1505731..95a23b7 100644 --- a/Modules/ossaudiodev.c +++ b/Modules/ossaudiodev.c @@ -474,6 +474,11 @@ oss_writeall(oss_audio_t *self, PyObject *args) if (!PyArg_ParseTuple(args, "y#:write", &cp, &size)) return NULL; + if (!_PyIsSelectable_fd(self->fd)) { + PyErr_SetString(PyExc_ValueError, + "file descriptor out of range for select"); + return NULL; + } /* use select to wait for audio device to be available */ FD_ZERO(&write_set_fds); FD_SET(self->fd, &write_set_fds); |