diff options
author | Michael W. Hudson <mwh@python.net> | 2001-08-30 14:50:20 (GMT) |
---|---|---|
committer | Michael W. Hudson <mwh@python.net> | 2001-08-30 14:50:20 (GMT) |
commit | 8019913e4a1e8e7716a7c44168c53d52a651fb7c (patch) | |
tree | ed1d3c3c37f48fb097a9014d3224d8f2c12db868 /Python | |
parent | 3c0fc84b15bd82d3a2b9a7612c9d14119c6f13f1 (diff) | |
download | cpython-8019913e4a1e8e7716a7c44168c53d52a651fb7c.zip cpython-8019913e4a1e8e7716a7c44168c53d52a651fb7c.tar.gz cpython-8019913e4a1e8e7716a7c44168c53d52a651fb7c.tar.bz2 |
fix for part of bug #453523: disable unmarshalling of code objects in
restricted execution mode.
Diffstat (limited to 'Python')
-rw-r--r-- | Python/marshal.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Python/marshal.c b/Python/marshal.c index 029f2b9..944ae35 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); |