From: Michael W. Hudson Date: Thu, 30 Aug 2001 14:50:20 +0000 (+0000) Subject: fix for part of bug #453523: disable unmarshalling of code objects in X-Git-Tag: v2.2a3~207 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8019913e4a1e8e7716a7c44168c53d52a651fb7c;p=thirdparty%2FPython%2Fcpython.git fix for part of bug #453523: disable unmarshalling of code objects in restricted execution mode. --- diff --git a/Python/marshal.c b/Python/marshal.c index 029f2b996df7..944ae35a0c1f 100644 --- a/Python/marshal.c +++ b/Python/marshal.c @@ -569,7 +569,13 @@ r_object(RFILE *p) return v; 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); int stacksize = r_short(p);