]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-38622: Ensure ctypes.PyObj_FromPtr audit event passes tuples as a single argument...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 18 Nov 2019 21:59:51 +0000 (13:59 -0800)
committerGitHub <noreply@github.com>
Mon, 18 Nov 2019 21:59:51 +0000 (13:59 -0800)
(cherry picked from commit dcf1f83de8678b09df5bd7d04ca5f4ef1cd02aca)

Co-authored-by: Steve Dower <steve.dower@python.org>
Modules/_ctypes/callproc.c

index 7fb570ed37f78566dfcb8c3e81cf65aa9aa4f6c1..77492e650ea484f389de056af0a1979c74ecb694 100644 (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);