summaryrefslogtreecommitdiffstats
path: root/PC
diff options
context:
space:
mode:
Diffstat (limited to 'PC')
-rwxr-xr-xPC/msvcrtmodule.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/PC/msvcrtmodule.c b/PC/msvcrtmodule.c
index e173fea..166df03 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);