diff options
author | Christian Heimes <christian@cheimes.de> | 2013-07-20 22:18:19 +0200 |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2013-07-20 22:18:19 +0200 |
commit | ae881cb8de901943f59f8a6b3943c9a9fee29754 (patch) | |
tree | 55c2834773f19df77e030e8f71d889ac7d585dcc /Python/dynload_shlib.c | |
parent | 783fb4cdcc3db67c7724089c624d597e80d7f79c (diff) | |
parent | 48b3d75488fddd1c276d2ddce9f509725e7cbf31 (diff) | |
download | cpython-ae881cb8de901943f59f8a6b3943c9a9fee29754.tar.gz |
Check return value of fstat() in _PyImport_GetDynLoadFunc()
CID 486250
Diffstat (limited to 'Python/dynload_shlib.c')
-rw-r--r-- | Python/dynload_shlib.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Python/dynload_shlib.c b/Python/dynload_shlib.c index 46fed6e7fd..50e6982663 100644 --- a/Python/dynload_shlib.c +++ b/Python/dynload_shlib.c @@ -81,7 +81,9 @@ dl_funcptr _PyImport_GetDynLoadFunc(const char *shortname, if (fp != NULL) { int i; struct stat statb; - fstat(fileno(fp), &statb); + if (fstat(fileno(fp), &statb) == -1) { + return PyErr_SetFromErrno(PyExc_IOError); + } for (i = 0; i < nhandles; i++) { if (statb.st_dev == handles[i].dev && statb.st_ino == handles[i].ino) { |