merge 3.3

This commit is contained in:
Benjamin Peterson 2013-01-18 00:10:37 -05:00
commit 9f30abd393
3 changed files with 13 additions and 3 deletions

View file

@ -422,7 +422,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;
}