[Python-checkins] CVS: python/dist/src/Python marshal.c,1.66,1.67

Michael Hudson mwh@users.sourceforge.net
Thu, 30 Aug 2001 07:50:22 -0700


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

Modified Files:
	marshal.c 
Log Message:
fix for part of bug #453523: disable unmarshalling of code objects in 
restricted execution mode.



Index: marshal.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/marshal.c,v
retrieving revision 1.66
retrieving revision 1.67
diff -C2 -d -r1.66 -r1.67
*** marshal.c	2001/08/29 02:28:41	1.66
--- marshal.c	2001/08/30 14:50:20	1.67
***************
*** 570,574 ****
  
  	case TYPE_CODE:
! 		{
  			int argcount = r_short(p);
  			int nlocals = r_short(p);
--- 570,580 ----
  
  	case TYPE_CODE:
! 		if (PyEval_GetRestricted()) {
! 			PyErr_SetString(PyExc_RuntimeError,
! 				"cannot unmarshal code objects in "
! 				"restricted execution mode");
! 			return NULL;
! 		}
! 		else {
  			int argcount = r_short(p);
  			int nlocals = r_short(p);