]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-41180: Audit code.__new__ when unmarshalling (GH-21271)
authortkmikan <36260601+tkmikan@users.noreply.github.com>
Fri, 3 Jul 2020 20:56:30 +0000 (04:56 +0800)
committerGitHub <noreply@github.com>
Fri, 3 Jul 2020 20:56:30 +0000 (21:56 +0100)
Python/marshal.c

index a0f6b9812601beeb1706f531db75f8965bd13c99..c4538bd373a82ef09cea343d5d210fa22dad8608 100644 (file)
@@ -1371,6 +1371,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,