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

Steve Dower webhook-mailer at python.org
Mon Nov 18 16:30:06 EST 2019


https://github.com/python/cpython/commit/dcf1f83de8678b09df5bd7d04ca5f4ef1cd02aca
commit: dcf1f83de8678b09df5bd7d04ca5f4ef1cd02aca
branch: master
author: Steve Dower <steve.dower at python.org>
committer: GitHub <noreply at github.com>
date: 2019-11-18T13:30:01-08:00
summary:

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

files:
M Modules/_ctypes/callproc.c

diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c
index 71060148d6651..7b13fa041a205 100644
--- a/Modules/_ctypes/callproc.c
+++ b/Modules/_ctypes/callproc.c
@@ -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);



More information about the Python-checkins mailing list