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: result of PyList_GetItem() not validated
Type: resource usage Stage:
Components: None Versions: Python 2.5.3
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: CWRU_Researcher1, rhettinger
Priority: normal Keywords:

Created on 2008-11-29 16:59 by CWRU_Researcher1, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg76603 - (view) Author: Brian Szuter (CWRU_Researcher1) Date: 2008-11-29 16:59
Python-2.5.2/Python/import.c(find_module)
Lines 1171

PyString_Check() is not called on the result of PyList_GetItem(), nor is
the result checked to see if it is NULL.
msg76616 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2008-11-29 18:17
PyObject *hook = PyList_GetItem(meta_path, i);
loader = PyObject_CallMethod(hook, "find_module",
  "sO", fullname, path != NULL ? path : Py_None);


The "hook" pointer is checked for NULL in PyObject_CallMethod() -- see
line 1947 in Objects/abstract.c.  The hook is a general object
(hopefully with a find_module() method), not a string.
History
Date User Action Args
2022-04-11 14:56:41adminsetgithub: 48712
2008-11-29 18:17:31rhettingersetstatus: open -> closed
resolution: not a bug
messages: + msg76616
nosy: + rhettinger
2008-11-29 16:59:43CWRU_Researcher1create