[Python-checkins] cpython (3.3): avoid referencing out-of-bounds memory

benjamin.peterson python-checkins at python.org
Sat Mar 15 03:55:06 CET 2014


http://hg.python.org/cpython/rev/ea27f0ed741f
changeset: 89661:ea27f0ed741f
branch: 3.3
user: Benjamin Peterson <benjamin at python.org>
date: Fri Mar 14 21:54:31 2014 -0500
summary:
 avoid referencing out-of-bounds memory
files:
 Objects/listobject.c | 2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Objects/listobject.c b/Objects/listobject.c
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -2036,7 +2036,7 @@
 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);
 }
 
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /