Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4a42cd4

Browse files
committed
avoid referencing past the bounds of an array
1 parent c77e7a4 commit 4a42cd4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Objects/listobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1963,7 +1963,7 @@ listsort(PyListObject *self, PyObject *args, PyObject *kwds)
19631963
if (keys[i] == NULL) {
19641964
for (i=i-1 ; i>=0 ; i--)
19651965
Py_DECREF(keys[i]);
1966-
if (keys != &ms.temparray[saved_ob_size+1])
1966+
if (saved_ob_size >= MERGESTATE_TEMP_SIZE/2)
19671967
PyMem_FREE(keys);
19681968
goto keyfunc_fail;
19691969
}

0 commit comments

Comments
 (0)