Skip to content

Commit d160e0f

Browse files
authored
bpo-41180: Audit code.__new__ when unmarshalling (GH-21271)
1 parent b1cc6ba commit d160e0f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Python/marshal.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1371,6 +1371,12 @@ r_object(RFILE *p)
13711371
if (lnotab == NULL)
13721372
goto code_error;
13731373

1374+
if (PySys_Audit("code.__new__", "OOOiiiiii",
1375+
code, filename, name, argcount, posonlyargcount,
1376+
kwonlyargcount, nlocals, stacksize, flags) < 0) {
1377+
goto code_error;
1378+
}
1379+
13741380
v = (PyObject *) PyCode_NewWithPosOnlyArgs(
13751381
argcount, posonlyargcount, kwonlyargcount,
13761382
nlocals, stacksize, flags,

0 commit comments

Comments
 (0)