From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Fri, 3 Jul 2020 21:16:23 +0000 (-0700) Subject: bpo-41180: Audit code.__new__ when unmarshalling (GH-21271) X-Git-Tag: v3.9.0b5~52 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1c776541a8805576c0a4363ca28c1d29423f02f6;p=thirdparty%2FPython%2Fcpython.git bpo-41180: Audit code.__new__ when unmarshalling (GH-21271) (cherry picked from commit d160e0f8e283d0a8737644588b38e8c6a07c134f) Co-authored-by: tkmikan <36260601+tkmikan@users.noreply.github.com> --- diff --git a/Python/marshal.c b/Python/marshal.c index a0f6b9812601..c4538bd373a8 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,