Mercurial > cpython-lru_cache-weakref
diff Objects/typeobject.c @ 25857:54f32ba7047c 2.2
Backport:
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:45:39 +0000 |
| parents | eea40c417205 |
| children | 8f743ebe6c66 |
line wrap: on
line diff
--- a/Objects/typeobject.c Fri Oct 18 16:34:26 2002 +0000 +++ b/Objects/typeobject.c Fri Oct 18 16:45:39 2002 +0000 @@ -2918,8 +2918,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);
