]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-41180: Audit code.__new__ when unmarshalling (GH-21271)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 3 Jul 2020 21:13:29 +0000 (14:13 -0700)
committerGitHub <noreply@github.com>
Fri, 3 Jul 2020 21:13:29 +0000 (14:13 -0700)
(cherry picked from commit d160e0f8e283d0a8737644588b38e8c6a07c134f)

Co-authored-by: tkmikan <36260601+tkmikan@users.noreply.github.com>
Python/marshal.c

index d3fee32380b58b814cdf69bad9211d4c252b1d39..a9ba7a436fd19d279f1e70483e5c41af0da76097 100644 (file)
@@ -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,