summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-01-18 17:06:32 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2017-01-18 17:06:32 (GMT)
commit06d34393c2f1f28bf97873418e2b981e7b188811 (patch)
tree5c868f57775e82f9f8f0bbfa9ce7117c78ece3fd /Objects
parentc75340a8fda52007855ca143513d2252c8cb1574 (diff)
downloadcpython-06d34393c2f1f28bf97873418e2b981e7b188811.zip
cpython-06d34393c2f1f28bf97873418e2b981e7b188811.tar.gz
cpython-06d34393c2f1f28bf97873418e2b981e7b188811.tar.bz2
_PyStack_AsDict() now checks kwnames != NULL
Issue #29259.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/abstract.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c
index 7b1f196..5864032 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;