mirror of
https://github.com/python/cpython.git
synced 2025-10-21 22:22:48 +00:00
check windows fd validity (closes #16992)
This commit is contained in:
parent
fc4aa76d59
commit
c68a4a048c
3 changed files with 13 additions and 3 deletions
|
@ -427,7 +427,7 @@ signal_set_wakeup_fd(PyObject *self, PyObject *args)
|
|||
return NULL;
|
||||
}
|
||||
#endif
|
||||
if (fd != -1 && fstat(fd, &buf) != 0) {
|
||||
if (fd != -1 && (!_PyVerify_fd(fd) || fstat(fd, &buf) != 0)) {
|
||||
PyErr_SetString(PyExc_ValueError, "invalid fd");
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue