Skip to content

Commit

Permalink
Add PyIter_Next error check in namespaceobject.c`
Browse files Browse the repository at this point in the history
  • Loading branch information
WolframAlph committed Dec 23, 2024
1 parent 992aff1 commit 1c58e95
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Objects/namespaceobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ namespace_repr(PyObject *ns)
goto error;
}

/* Check if loop ended because of exception in PyIter_Next */
if (PyErr_Occurred()) {
goto error;
}

separator = PyUnicode_FromString(", ");
if (separator == NULL)
goto error;
Expand Down

0 comments on commit 1c58e95

Please sign in to comment.