Skip to content

Commit c30cad0

Browse files
[3.13] pythongh-128198: Add missing error checks for usages of PyIter_Next() (pythonGH-128199) (pythonGH-128272)
(cherry picked from commit 5c814c8) Co-authored-by: Yan Yanchii <[email protected]>
1 parent 32adae1 commit c30cad0

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Objects/frameobject.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,10 @@ framelocalsproxy_merge(PyObject* self, PyObject* other)
263263

264264
Py_DECREF(iter);
265265

266+
if (PyErr_Occurred()) {
267+
return -1;
268+
}
269+
266270
return 0;
267271
}
268272

Objects/namespaceobject.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@ namespace_repr(PyObject *ns)
141141
goto error;
142142
}
143143

144+
if (PyErr_Occurred()) {
145+
goto error;
146+
}
147+
144148
separator = PyUnicode_FromString(", ");
145149
if (separator == NULL)
146150
goto error;

0 commit comments

Comments
 (0)