mirror of https://github.com/python/cpython
Check return value of fstat() in _PyImport_GetDynLoadFunc()
CID 486250
This commit is contained in:
commit
7bc80fcf4e
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue