diff options
Diffstat (limited to 'PC')
-rwxr-xr-x | PC/msvcrtmodule.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/PC/msvcrtmodule.c b/PC/msvcrtmodule.c index 9a86d5e..37631a7 100755 --- a/PC/msvcrtmodule.c +++ b/PC/msvcrtmodule.c @@ -143,6 +143,9 @@ msvcrt_get_osfhandle(PyObject *self, PyObject *args) if (!PyArg_ParseTuple(args,"i:get_osfhandle", &fd)) return NULL; + if (!_PyVerify_fd(fd)) + return PyErr_SetFromErrno(PyExc_IOError); + handle = _get_osfhandle(fd); if (handle == -1) return PyErr_SetFromErrno(PyExc_IOError); |