summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2020-07-03 21:13:29 (GMT)
committerGitHub <noreply@github.com>2020-07-03 21:13:29 (GMT)
commitc1d916595eb6979d4d87cc3e5216e26b3c6fac25 (patch)
tree2a304f785d611a0b71c2b30fb96be0d0ba704535 /Python
parent53d2b715d10e5c81cb9c86fd25e88ace4e41bc25 (diff)
downloadcpython-c1d916595eb6979d4d87cc3e5216e26b3c6fac25.zip
cpython-c1d916595eb6979d4d87cc3e5216e26b3c6fac25.tar.gz
cpython-c1d916595eb6979d4d87cc3e5216e26b3c6fac25.tar.bz2
bpo-41180: Audit code.__new__ when unmarshalling (GH-21271)
(cherry picked from commit d160e0f8e283d0a8737644588b38e8c6a07c134f) Co-authored-by: tkmikan <36260601+tkmikan@users.noreply.github.com>
Diffstat (limited to 'Python')
-rw-r--r--Python/marshal.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Python/marshal.c b/Python/marshal.c
index d3fee32..a9ba7a4 100644
--- a/Python/marshal.c
+++ b/Python/marshal.c
@@ -1396,6 +1396,12 @@ r_object(RFILE *p)
if (lnotab == NULL)
goto code_error;
+ if (PySys_Audit("code.__new__", "OOOiiiiii",
+ code, filename, name, argcount, posonlyargcount,
+ kwonlyargcount, nlocals, stacksize, flags) < 0) {
+ goto code_error;
+ }
+
v = (PyObject *) PyCode_NewWithPosOnlyArgs(
argcount, posonlyargcount, kwonlyargcount,
nlocals, stacksize, flags,