summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2013-07-26 21:04:39 (GMT)
committerChristian Heimes <christian@cheimes.de>2013-07-26 21:04:39 (GMT)
commitf6e7e36c3d3ffa0c537a30253488fca4464ed409 (patch)
tree005e3dc64fcdb63869f09f0de42c307e3f321381
parent4ebf6d7c3c2a0b04dd815c0b042294e36d644954 (diff)
parent6ca8a05f10b37e068f7c7da196d0d97706b6f15f (diff)
downloadcpython-f6e7e36c3d3ffa0c537a30253488fca4464ed409.zip
cpython-f6e7e36c3d3ffa0c537a30253488fca4464ed409.tar.gz
cpython-f6e7e36c3d3ffa0c537a30253488fca4464ed409.tar.bz2
Issue #18561: Skip name in ctypes' _build_callargs() if name is NULL.
CID 486199
-rw-r--r--Misc/NEWS2
-rw-r--r--Modules/_ctypes/_ctypes.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index 10ea9f7..321ab6e 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -168,6 +168,8 @@ Core and Builtins
Library
-------
+- Issue #18561: Skip name in ctypes' _build_callargs() if name is NULL.
+
- Issue #18559: Fix NULL pointer dereference error in _pickle module
- Issue #18556: Check the return type of PyUnicode_AsWideChar() in ctype's
diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c
index 6f40b1a..7c34f77 100644
--- a/Modules/_ctypes/_ctypes.c
+++ b/Modules/_ctypes/_ctypes.c
@@ -3453,7 +3453,7 @@ _get_arg(int *pindex, PyObject *name, PyObject *defval, PyObject *inargs, PyObje
Py_INCREF(v);
return v;
}
- if (kwds && (v = PyDict_GetItem(kwds, name))) {
+ if (kwds && name && (v = PyDict_GetItem(kwds, name))) {
++*pindex;
Py_INCREF(v);
return v;