[Python-checkins] bpo-41180: Audit code.__new__ when unmarshalling (GH-21271)

tkmikan webhook-mailer at python.org
Fri Jul 3 16:56:38 EDT 2020


https://github.com/python/cpython/commit/d160e0f8e283d0a8737644588b38e8c6a07c134f
commit: d160e0f8e283d0a8737644588b38e8c6a07c134f
branch: master
author: tkmikan <36260601+tkmikan at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2020-07-03T21:56:30+01:00
summary:

bpo-41180: Audit code.__new__ when unmarshalling (GH-21271)

files:
M Python/marshal.c

diff --git a/Python/marshal.c b/Python/marshal.c
index a0f6b9812601b..c4538bd373a82 100644
--- a/Python/marshal.c
+++ b/Python/marshal.c
@@ -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,



More information about the Python-checkins mailing list