diff options
author | Charles-François Natali <neologix@free.fr> | 2011-08-28 15:51:43 (GMT) |
---|---|---|
committer | Charles-François Natali <neologix@free.fr> | 2011-08-28 15:51:43 (GMT) |
commit | aa26b275034c07784c4d64e9a2bc26c742577327 (patch) | |
tree | d331c0e5f2dd0fc0f754ffebaf9ebb9e5c4f7958 /Modules/ossaudiodev.c | |
parent | 524148ad7a3e5420abf867b1e30017b5ca2311a4 (diff) | |
download | cpython-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/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 e660e50..cdf6beb 100644 --- a/Modules/ossaudiodev.c +++ b/Modules/ossaudiodev.c @@ -425,6 +425,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); |