summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2002-06-20 23:13:17 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2002-06-20 23:13:17 (GMT)
commit8b47dffc932fe1452a7f5fae70307c0915cd3591 (patch)
tree950044b1d832e2c3832ab3cdf65dd785a0a6b232 /Objects
parentfc7d379a9692d56b40d437fa93e3b16edb9c27d0 (diff)
downloadcpython-8b47dffc932fe1452a7f5fae70307c0915cd3591.zip
cpython-8b47dffc932fe1452a7f5fae70307c0915cd3591.tar.gz
cpython-8b47dffc932fe1452a7f5fae70307c0915cd3591.tar.bz2
Fix for SF bug 571885
When resizing a tuple, zero out the memory starting at the end of the old tuple not at the beginning of the old tuple.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/tupleobject.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c
index 525e8f6..4c264fd 100644
--- a/Objects/tupleobject.c
+++ b/Objects/tupleobject.c
@@ -696,8 +696,8 @@ _PyTuple_Resize(PyObject **pv, int newsize)
_Py_NewReference((PyObject *) sv);
/* Zero out items added by growing */
if (newsize > oldsize)
- memset(sv->ob_item, 0,
- sizeof(*sv->ob_item) * (newsize - oldsize));
+ memset(&sv->ob_item[oldsize], 0,
+ sizeof(*sv->ob_item) * (newsize - oldsize));
*pv = (PyObject *) sv;
_PyObject_GC_TRACK(sv);
return 0;