mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
Issue #12287: Fix a stack corruption in ossaudiodev module when the FD is
greater than FD_SETSIZE.
This commit is contained in:
parent
524148ad7a
commit
aa26b27503
6 changed files with 21 additions and 19 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue