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

Miss Islington (bot) webhook-mailer at python.org
Fri Jul 3 17:13:37 EDT 2020


https://github.com/python/cpython/commit/c1d916595eb6979d4d87cc3e5216e26b3c6fac25
commit: c1d916595eb6979d4d87cc3e5216e26b3c6fac25
branch: 3.8
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2020-07-03T14:13:29-07:00
summary:

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

(cherry picked from commit d160e0f8e283d0a8737644588b38e8c6a07c134f)

Co-authored-by: tkmikan <36260601+tkmikan at users.noreply.github.com>

files:
M Python/marshal.c

diff --git a/Python/marshal.c b/Python/marshal.c
index d3fee32380b58..a9ba7a436fd19 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,



More information about the Python-checkins mailing list