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: PyList_GetItem() result and parameters not fully validated
Type: performance 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 17:06 by CWRU_Researcher1, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg76605 - (view) Author: Brian Szuter (CWRU_Researcher1) Date: 2008-11-29 17:06
Python-2.5.2/Python/codecs.c(_PyCodec_Lookup)
Lines 106, 144

PyString_Check() is not called on the result of PyList_GetItem() and the
first parameter of PyList_GetItem() does not have PyList_Check() called
on it.
(See Python-2.5.2/Python/traceback.c(tb_displayline) for a correct
instance of the pattern)
msg76617 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2008-11-29 18:21
Python/codecs.c line 144-147:

	func = PyList_GetItem(interp->codec_search_path, i);
	if (func == NULL)
	    goto onError;
	result = PyEval_CallObject(func, args);

The "func" result is expected to be a callable, not a string.

The code for PyList_GetItem does the list check.
History
Date User Action Args
2022-04-11 14:56:41adminsetgithub: 48714
2008-11-29 18:21:54rhettingersetstatus: open -> closed
resolution: not a bug
messages: + msg76617
nosy: + rhettinger
2008-11-29 17:06:35CWRU_Researcher1create