Issue #12287: Fix a stack corruption in ossaudiodev module when the FD is

greater than FD_SETSIZE.
This commit is contained in:
Charles-François Natali 2011-08-28 17:51:43 +02:00
parent 524148ad7a
commit aa26b27503
6 changed files with 21 additions and 19 deletions

View file

@ -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);