[issue4460] The parameter of PyInt_AsSsize_t() is not checked to see if it is NULL

Brian Szuter report at bugs.python.org
Sat Nov 29 18:34:48 CET 2008


Brian Szuter <Brian.Szuter at gmail.com> added the comment:

abstract.c(PyNumber_AsSsize_t) shows this check of PyInt_AsSsize_t()'s
parameter:

980: 	if (value == NULL)    
981: 		return -1;    
982:     
983: 	/* We're done if PyInt_AsSsize_t() returns without error. */   
984: 	result = PyInt_AsSsize_t(value);

Similar checks of this parameter occur in the following places:
classobject.c(instance_length) 980
sliceobject.c(PySlice_GetIndices) 1020
sliceobject.c(PySlice_GetIndices) 123
sliceobject.c(PySlice_GetIndices) 115
ceval.c(PyEval_EvalFrameEx) 1179
_sre.c(match_getindex) 2772

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4460>
_______________________________________


More information about the Python-bugs-list mailing list