mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Fix SF # 624982, Potential AV in slot_sq_item, by Greg Chapman
Don't crash when getting value of a property raises an exception
This commit is contained in:
parent
9def6a3a77
commit
673cd824ba
2 changed files with 17 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue