[3.13] gh-128198: Add missing error checks for usages of PyIter_Next() (GH-128199) (GH-128272)

(cherry picked from commit 5c814c83cd)

Co-authored-by: Yan Yanchii <yyanchiy@gmail.com>
This commit is contained in:
Serhiy Storchaka 2024-12-26 12:39:47 +02:00 committed by GitHub
parent 32adae1a10
commit c30cad0638
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 0 deletions

View File

@ -263,6 +263,10 @@ framelocalsproxy_merge(PyObject* self, PyObject* other)
Py_DECREF(iter);
if (PyErr_Occurred()) {
return -1;
}
return 0;
}

View File

@ -141,6 +141,10 @@ namespace_repr(PyObject *ns)
goto error;
}
if (PyErr_Occurred()) {
goto error;
}
separator = PyUnicode_FromString(", ");
if (separator == NULL)
goto error;