From 8019913e4a1e8e7716a7c44168c53d52a651fb7c Mon Sep 17 00:00:00 2001 From: "Michael W. Hudson" Date: Thu, 30 Aug 2001 14:50:20 +0000 Subject: [PATCH] fix for part of bug #453523: disable unmarshalling of code objects in restricted execution mode. --- Python/marshal.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Python/marshal.c b/Python/marshal.c index 029f2b996d..944ae35a0c 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); -- 2.40.0