[Python-checkins] python/dist/src/Objects typeobject.c,2.184,2.185
nnorwitz@users.sourceforge.net
nnorwitz@users.sourceforge.net
Fri, 18 Oct 2002 09:33:15 -0700
Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv18066/Objects
Modified Files:
typeobject.c
Log Message:
Fix SF # 624982, Potential AV in slot_sq_item, by Greg Chapman
Don't crash when getting value of a property raises an exception
Index: typeobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v
retrieving revision 2.184
retrieving revision 2.185
diff -C2 -d -r2.184 -r2.185
*** typeobject.c 18 Oct 2002 13:51:49 -0000 2.184
--- typeobject.c 18 Oct 2002 16:33:12 -0000 2.185
***************
*** 3146,3151 ****
if ((f = func->ob_type->tp_descr_get) == NULL)
Py_INCREF(func);
! else
func = f(func, self, (PyObject *)(self->ob_type));
ival = PyInt_FromLong(i);
if (ival != NULL) {
--- 3146,3155 ----
if ((f = func->ob_type->tp_descr_get) == NULL)
Py_INCREF(func);
! else {
func = f(func, self, (PyObject *)(self->ob_type));
+ if (func == NULL) {
+ return NULL;
+ }
+ }
ival = PyInt_FromLong(i);
if (ival != NULL) {