Mercurial > cpython-lru_cache-weakref
diff Objects/typeobject.c @ 25853:680bfcc9ca06 legacy-trunk
Fix SF # 624982, Potential AV in slot_sq_item, by Greg Chapman
Don't crash when getting value of a property raises an exception
| author | Neal Norwitz <nnorwitz@gmail.com> |
|---|---|
| date | Fri, 18 Oct 2002 16:33:13 +0000 |
| parents | 243503926c81 |
| children | c95190532c0c |
line wrap: on
line diff
--- a/Objects/typeobject.c Fri Oct 18 16:11:54 2002 +0000 +++ b/Objects/typeobject.c Fri Oct 18 16:33:13 2002 +0000 @@ -3145,8 +3145,12 @@ if (func != NULL) { if ((f = func->ob_type->tp_descr_get) == NULL) Py_INCREF(func); - else + else { func = f(func, self, (PyObject *)(self->ob_type)); + if (func == NULL) { + return NULL; + } + } ival = PyInt_FromLong(i); if (ival != NULL) { args = PyTuple_New(1);
