summaryrefslogtreecommitdiffstats
path: root/Modules/signalmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/signalmodule.c')
-rw-r--r--Modules/signalmodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c
index eb89a03..0aac98b 100644
--- a/Modules/signalmodule.c
+++ b/Modules/signalmodule.c
@@ -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;
}