bpo-38622: Ensure ctypes.PyObj_FromPtr audit event passes tuples as a single argument (GH-17243)

This commit is contained in:
Steve Dower 2019-11-18 13:30:01 -08:00 committed by GitHub
parent 00923c6399
commit dcf1f83de8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -1631,7 +1631,7 @@ addressof(PyObject *self, PyObject *obj)
"invalid type");
return NULL;
}
if (PySys_Audit("ctypes.addressof", "O", obj) < 0) {
if (PySys_Audit("ctypes.addressof", "(O)", obj) < 0) {
return NULL;
}
return PyLong_FromVoidPtr(((CDataObject *)obj)->b_ptr);
@ -1651,7 +1651,7 @@ My_PyObj_FromPtr(PyObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "O&:PyObj_FromPtr", converter, &ob)) {
return NULL;
}
if (PySys_Audit("ctypes.PyObj_FromPtr", "O", ob) < 0) {
if (PySys_Audit("ctypes.PyObj_FromPtr", "(O)", ob) < 0) {
return NULL;
}
Py_INCREF(ob);