diff options
| author | Charles-François Natali <neologix@free.fr> | 2011-08-28 18:10:27 +0200 |
|---|---|---|
| committer | Charles-François Natali <neologix@free.fr> | 2011-08-28 18:10:27 +0200 |
| commit | 305d15175ea4e3842fa58ddc32f6ba9342e73c87 (patch) | |
| tree | 26bcd0c192a968ea8eda2f42ed4243992095f593 /Modules/ossaudiodev.c | |
| parent | e2083576cbdce24cb51fe8880b54564a6efdc212 (diff) | |
| parent | 1fa4d5cbe6e674294c63d8162deecdaf7e0654a5 (diff) | |
| download | cpython-305d15175ea4e3842fa58ddc32f6ba9342e73c87.tar.gz | |
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 1505731449..95a23b7ea3 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); |
