[Python-checkins] CVS: python/dist/src/Objects listobject.c,2.83,2.84

Trent Mick python-dev@python.org
Sun, 13 Aug 2000 15:47:48 -0700


Update of /cvsroot/python/python/dist/src/Objects
In directory slayer.i.sourceforge.net:/tmp/cvs-serv1607/Objects

Modified Files:
	listobject.c 
Log Message:
Check for overflow in list object insertion and raise OverflowError.
see: http://www.python.org/pipermail/python-dev/2000-August/014971.html



Index: listobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/listobject.c,v
retrieving revision 2.83
retrieving revision 2.84
diff -C2 -r2.83 -r2.84
*** listobject.c	2000/07/25 12:56:38	2.83
--- listobject.c	2000/08/13 22:47:45	2.84
***************
*** 135,138 ****
--- 135,143 ----
  		return -1;
  	}
+ 	if (self->ob_size == INT_MAX) {
+ 		PyErr_SetString(PyExc_OverflowError,
+ 			"cannot add more objects to list");
+ 		return -1;
+ 	}
  	items = self->ob_item;
  	NRESIZE(items, PyObject *, self->ob_size+1);