summaryrefslogtreecommitdiffstats
path: root/PC/msvcrtmodule.c
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-09-04 21:02:41 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-09-04 21:02:41 (GMT)
commit0bb502dcac9c687201aa58632e3dcbee1ac1168c (patch)
tree989f6aeab00828e0c9d535ee0a82ecc51a27a7f3 /PC/msvcrtmodule.c
parentec80478967afc0cf4e600a48dfa633603c20ac0e (diff)
downloadcpython-0bb502dcac9c687201aa58632e3dcbee1ac1168c.zip
cpython-0bb502dcac9c687201aa58632e3dcbee1ac1168c.tar.gz
cpython-0bb502dcac9c687201aa58632e3dcbee1ac1168c.tar.bz2
Merged revisions 84506 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r84506 | antoine.pitrou | 2010-09-04 22:53:29 +0200 (sam., 04 sept. 2010) | 5 lines Issue #8734: Avoid crash in msvcrt.get_osfhandle() when an invalid file descriptor is provided. Patch by Pascal Chambon. ........
Diffstat (limited to 'PC/msvcrtmodule.c')
-rwxr-xr-xPC/msvcrtmodule.c3
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);