Prevent crash if alloc of garbage fails. Found by Typo.pl.
Will backport.
This commit is contained in:
parent
21997afb0c
commit
e7e4e2dfab
|
@ -2608,6 +2608,11 @@ list_ass_subscript(PyListObject* self, PyObject* item, PyObject* value)
|
|||
|
||||
garbage = (PyObject**)
|
||||
PyMem_MALLOC(slicelength*sizeof(PyObject*));
|
||||
if (!garbage) {
|
||||
Py_DECREF(seq);
|
||||
PyErr_NoMemory();
|
||||
return -1;
|
||||
}
|
||||
|
||||
selfitems = self->ob_item;
|
||||
seqitems = PySequence_Fast_ITEMS(seq);
|
||||
|
|
Loading…
Reference in New Issue