diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2002-10-18 16:33:13 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2002-10-18 16:33:13 (GMT) |
commit | 673cd824ba009ecbb0723192867c27c8e27c0037 (patch) | |
tree | 1f521c95e854090065da12ceb9e1925e3911a52d /Objects | |
parent | 9def6a3a77569214b49d1b54ef138b0e4985a6bd (diff) | |
download | cpython-673cd824ba009ecbb0723192867c27c8e27c0037.zip cpython-673cd824ba009ecbb0723192867c27c8e27c0037.tar.gz cpython-673cd824ba009ecbb0723192867c27c8e27c0037.tar.bz2 |
Fix SF # 624982, Potential AV in slot_sq_item, by Greg Chapman
Don't crash when getting value of a property raises an exception
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/typeobject.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c index ed5b829..e624ec4 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -3145,8 +3145,12 @@ slot_sq_item(PyObject *self, int i) 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); |