Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Commit 06d3439

Browse files
committed
_PyStack_AsDict() now checks kwnames != NULL
Issue python#29259.
1 parent c75340a commit 06d3439

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Objects/abstract.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2399,10 +2399,12 @@ _PyObject_Call_Prepend(PyObject *callable,
23992399
PyObject *
24002400
_PyStack_AsDict(PyObject **values, PyObject *kwnames)
24012401
{
2402-
Py_ssize_t nkwargs = PyTuple_GET_SIZE(kwnames);
2402+
Py_ssize_t nkwargs;
24032403
PyObject *kwdict;
24042404
Py_ssize_t i;
24052405

2406+
assert(kwnames != NULL);
2407+
nkwargs = PyTuple_GET_SIZE(kwnames);
24062408
kwdict = _PyDict_NewPresized(nkwargs);
24072409
if (kwdict == NULL) {
24082410
return NULL;

0 commit comments

Comments
 (0)