[Python-checkins] python/dist/src/Modules cPickle.c,2.109,2.110

tim_one@users.sourceforge.net tim_one@users.sourceforge.net
Sun, 02 Feb 2003 08:16:32 -0800


Update of /cvsroot/python/python/dist/src/Modules
In directory sc8-pr-cvs1:/tmp/cvs-serv13585/Modules

Modified Files:
	cPickle.c 
Log Message:
dump():  Added asserts that self->proto is sane.


Index: cPickle.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/cPickle.c,v
retrieving revision 2.109
retrieving revision 2.110
diff -C2 -d -r2.109 -r2.110
*** cPickle.c	2 Feb 2003 16:14:23 -0000	2.109
--- cPickle.c	2 Feb 2003 16:16:30 -0000	2.110
***************
*** 2218,2222 ****
  
  		bytes[0] = PROTO;
! 		bytes[1] = self->proto;
  		if (self->write_func(self, bytes, 2) < 0)
  			return -1;
--- 2218,2223 ----
  
  		bytes[0] = PROTO;
! 		assert(self->proto >= 0 && self->proto < 256);
! 		bytes[1] = (char)self->proto;
  		if (self->write_func(self, bytes, 2) < 0)
  			return -1;