homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: _PyImport_GetDynLoadFunc() doesn't check return value of fstat()
Type: behavior Stage: resolved
Components: Interpreter Core Versions: Python 3.2, Python 3.3, Python 3.4, Python 2.7
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: christian.heimes, eric.snow, jcea, vstinner
Priority: normal Keywords:

Created on 2012年09月09日 21:56 by christian.heimes, last changed 2022年04月11日 14:57 by admin. This issue is now closed.

Messages (4)
msg170138 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2012年09月09日 21:56
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;
}
}
msg193745 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2013年07月26日 20:47
Already fixed
msg193747 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2013年07月26日 20:49
changeset: 84741:654268ff29b5
branch: 3.3
parent: 84736:ce771c2d0220
user: Christian Heimes <christian@cheimes.de>
date: Sat Jul 20 22:17:55 2013 +0200
files: Python/dynload_shlib.c
description:
Check return value of fstat() in _PyImport_GetDynLoadFunc()
CID 486250
msg193749 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2013年07月26日 20:51
I wonder why I did not mention the issue # in the checkin message... Thanks :)
History
Date User Action Args
2022年04月11日 14:57:35adminsetgithub: 60096
2013年07月26日 20:51:00christian.heimessetmessages: + msg193749
2013年07月26日 20:49:09vstinnersetnosy: + vstinner
messages: + msg193747
2013年07月26日 20:47:56christian.heimessetstatus: open -> closed
resolution: out of date
messages: + msg193745

stage: patch review -> resolved
2012年11月13日 06:02:22eric.snowsetnosy: + eric.snow
2012年09月10日 02:26:19jceasetnosy: + jcea
2012年09月09日 21:56:02christian.heimescreate

AltStyle によって変換されたページ (->オリジナル) /