Author christian.heimes
Recipients christian.heimes
Date 2012-09-09.21:56:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1347227762.77.0.329908285172.issue15892@psf.upfronthosting.co.za>
In-reply-to
Content
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;
}
}
History
Date User Action Args
2012-09-09 21:56:02christian.heimessetrecipients: + christian.heimes
2012-09-09 21:56:02christian.heimessetmessageid: <1347227762.77.0.329908285172.issue15892@psf.upfronthosting.co.za>
2012-09-09 21:56:02christian.heimeslinkissue15892 messages
2012-09-09 21:56:02christian.heimescreate