[Python-checkins] CVS: python/dist/src/Python ceval.c,2.169,2.170

Barry A. Warsaw python-dev@python.org
Wed, 29 Mar 2000 13:30:05 -0500 (EST)


Update of /projects/cvsroot/python/dist/src/Python
In directory anthem:/home/bwarsaw/projects/python/Python

Modified Files:
	ceval.c 
Log Message:
eval_code2(): In the extended calling syntax opcodes, you must check
the return value of PySequence_Length().  If an exception occurred,
the returned length will be -1.  Make sure this doesn't get obscurred,
and that the bogus length isn't used.


Index: ceval.c
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Python/ceval.c,v
retrieving revision 2.169
retrieving revision 2.170
diff -C2 -r2.169 -r2.170
*** ceval.c	2000/03/28 23:49:16	2.169
--- ceval.c	2000/03/29 18:30:03	2.170
***************
*** 1637,1640 ****
--- 1637,1648 ----
  			    }
  			    nstar = PySequence_Length(stararg);
+ 			    if (nstar < 0) {
+ 				    if (!PyErr_Occurred)
+ 					    PyErr_SetString(
+ 						    PyExc_TypeError,
+ 						    "len() of unsized object");
+ 				    x = NULL;
+ 				    break;
+ 			    }
  			}
  			if (nk > 0) {