Skip to content

Commit

Permalink
[3.13] gh-128198: Add missing error checks for usages of PyIter_Next() (
Browse files Browse the repository at this point in the history
GH-128199) (GH-128272)

(cherry picked from commit 5c814c8)

Co-authored-by: Yan Yanchii <[email protected]>
  • Loading branch information
serhiy-storchaka and WolframAlph authored Dec 26, 2024
1 parent 32adae1 commit c30cad0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Objects/frameobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,10 @@ framelocalsproxy_merge(PyObject* self, PyObject* other)

Py_DECREF(iter);

if (PyErr_Occurred()) {
return -1;
}

return 0;
}

Expand Down
4 changes: 4 additions & 0 deletions Objects/namespaceobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ namespace_repr(PyObject *ns)
goto error;
}

if (PyErr_Occurred()) {
goto error;
}

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

0 comments on commit c30cad0

Please sign in to comment.