avoid referencing out-of-bounds memory

This commit is contained in:
Benjamin Peterson 2014-03-14 21:54:31 -05:00
parent 45c9dceb56
commit ef87f8cb57
1 changed files with 1 additions and 1 deletions

View File

@ -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);
}