From: Benjamin Peterson Date: Sat, 15 Mar 2014 17:21:28 +0000 (-0500) Subject: avoid referencing past the bounds of an array X-Git-Tag: v3.4.1rc1~233^2~11^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4a42cd48d57d67362301ee4ac0344199217fa645;p=thirdparty%2FPython%2Fcpython.git avoid referencing past the bounds of an array --- diff --git a/Objects/listobject.c b/Objects/listobject.c index 5f3e28282793..ae365770ea5f 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -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; }