From 06d34393c2f1f28bf97873418e2b981e7b188811 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 18 Jan 2017 18:06:32 +0100 Subject: [PATCH] _PyStack_AsDict() now checks kwnames != NULL Issue #29259. --- Objects/abstract.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Objects/abstract.c b/Objects/abstract.c index 7b1f196891..58640323dc 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -2399,10 +2399,12 @@ _PyObject_Call_Prepend(PyObject *callable, PyObject * _PyStack_AsDict(PyObject **values, PyObject *kwnames) { - Py_ssize_t nkwargs = PyTuple_GET_SIZE(kwnames); + Py_ssize_t nkwargs; PyObject *kwdict; Py_ssize_t i; + assert(kwnames != NULL); + nkwargs = PyTuple_GET_SIZE(kwnames); kwdict = _PyDict_NewPresized(nkwargs); if (kwdict == NULL) { return NULL; -- 2.40.0