Commit 27c4c3ec authored by Christian Heimes's avatar Christian Heimes

Check return value of fstat() in _PyImport_GetDynLoadFunc()

CID 486250
parent 58ceecfe
...@@ -90,7 +90,9 @@ dl_funcptr _PyImport_GetDynLoadFunc(const char *shortname, ...@@ -90,7 +90,9 @@ dl_funcptr _PyImport_GetDynLoadFunc(const char *shortname,
if (fp != NULL) { if (fp != NULL) {
int i; int i;
struct stat statb; struct stat statb;
fstat(fileno(fp), &statb); if (fstat(fileno(fp), &statb) == -1) {
return PyErr_SetFromErrno(PyExc_IOError);
}
for (i = 0; i < nhandles; i++) { for (i = 0; i < nhandles; i++) {
if (statb.st_dev == handles[i].dev && if (statb.st_dev == handles[i].dev &&
statb.st_ino == handles[i].ino) { statb.st_ino == handles[i].ino) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment