From ef87f8cb57e147b48665c06b41ac10b5cf4904c4 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Fri, 14 Mar 2014 21:54:31 -0500 Subject: [PATCH] avoid referencing out-of-bounds memory --- Objects/listobject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Objects/listobject.c b/Objects/listobject.c index 143c7b3788..5f3e282827 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -2036,7 +2036,7 @@ fail: if (keys != NULL) { for (i = 0; i < saved_ob_size; i++) Py_DECREF(keys[i]); - if (keys != &ms.temparray[saved_ob_size+1]) + if (saved_ob_size >= MERGESTATE_TEMP_SIZE/2) PyMem_FREE(keys); } -- 2.40.0