[Python-checkins] python/dist/src/Objects tupleobject.c,2.67,2.68

jhylton@users.sourceforge.net jhylton@users.sourceforge.net
Thu, 20 Jun 2002 16:13:19 -0700


Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv18791

Modified Files:
	tupleobject.c 
Log Message:
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.


Index: tupleobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/tupleobject.c,v
retrieving revision 2.67
retrieving revision 2.68
diff -C2 -d -r2.67 -r2.68
*** tupleobject.c	13 Jun 2002 21:11:09 -0000	2.67
--- tupleobject.c	20 Jun 2002 23:13:17 -0000	2.68
***************
*** 697,702 ****
  	/* Zero out items added by growing */
  	if (newsize > oldsize)
! 		memset(sv->ob_item, 0,
! 			sizeof(*sv->ob_item) * (newsize - oldsize));
  	*pv = (PyObject *) sv;
  	_PyObject_GC_TRACK(sv);
--- 697,702 ----
  	/* Zero out items added by growing */
  	if (newsize > oldsize)
! 		memset(&sv->ob_item[oldsize], 0,
! 		       sizeof(*sv->ob_item) * (newsize - oldsize));
  	*pv = (PyObject *) sv;
  	_PyObject_GC_TRACK(sv);