New submission from Christian Heimes:

The function _PyImport_GetDynLoadFunc() in Python/dynload_shlib.c doesn't check 
the return value of fstat()

CID 486250: Other violation (CHECKED_RETURN)At (3): Calling function 
"fstat(fileno(fp), &statb)" without checking return value. This library 
function may fail and return an error code.
At (4): No check of the return value of "fstat(fileno(fp), &statb)".
 93        fstat(fileno(fp), &statb);

Suggested fix:
if (fstat(fileno(fp), &statb) == -1) {
    PyErr_SetFromErrnoWithFilename(PyExc_IOError, pathname);
    return NULL;
}
}

----------
components: Interpreter Core
messages: 170138
nosy: christian.heimes
priority: normal
severity: normal
stage: patch review
status: open
title: _PyImport_GetDynLoadFunc() doesn't check return value of fstat()
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue15892>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to