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

Skip to content

Commit ef87f8c

Browse files
committed
avoid referencing out-of-bounds memory
1 parent 45c9dce commit ef87f8c

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
@@ -2036,7 +2036,7 @@ listsort(PyListObject *self, PyObject *args, PyObject *kwds)
20362036
if (keys != NULL) {
20372037
for (i = 0; i < saved_ob_size; i++)
20382038
Py_DECREF(keys[i]);
2039-
if (keys != &ms.temparray[saved_ob_size+1])
2039+
if (saved_ob_size >= MERGESTATE_TEMP_SIZE/2)
20402040
PyMem_FREE(keys);
20412041
}
20422042

0 commit comments

Comments
 (0)