Commit 4a42cd48 authored by Benjamin Peterson's avatar Benjamin Peterson

avoid referencing past the bounds of an array

parent c77e7a4f
......@@ -1963,7 +1963,7 @@ listsort(PyListObject *self, PyObject *args, PyObject *kwds)
if (keys[i] == NULL) {
for (i=i-1 ; i>=0 ; i--)
Py_DECREF(keys[i]);
if (keys != &ms.temparray[saved_ob_size+1])
if (saved_ob_size >= MERGESTATE_TEMP_SIZE/2)
PyMem_FREE(keys);
goto keyfunc_fail;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment