diff options
author | Christian Heimes <christian@cheimes.de> | 2013-07-20 22:17:55 +0200 |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2013-07-20 22:17:55 +0200 |
commit | 48b3d75488fddd1c276d2ddce9f509725e7cbf31 (patch) | |
tree | da24377c098795978a534507d881f9daf69443fe /Python/dynload_shlib.c | |
parent | 2e6eb6e477f5c8acf5ff88e5ac2bbf0f92a93691 (diff) | |
download | cpython-48b3d75488fddd1c276d2ddce9f509725e7cbf31.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 0ca65c7877..e220b21522 100644 --- a/Python/dynload_shlib.c +++ b/Python/dynload_shlib.c @@ -90,7 +90,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) { |