From: Christian Heimes Date: Fri, 26 Jul 2013 21:04:29 +0000 (+0200) Subject: Issue #18561: Skip name in ctypes' _build_callargs() if name is NULL. X-Git-Tag: v3.4.0a1~70^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6ca8a05f10b37e068f7c7da196d0d97706b6f15f;p=python Issue #18561: Skip name in ctypes' _build_callargs() if name is NULL. CID 486199 --- diff --git a/Misc/NEWS b/Misc/NEWS index 505fab5820..769b80e730 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -54,6 +54,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 value of a PyUnicode_AsWideChar() call in diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c index a025a732f6..9a37aacf0c 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;