8000 gh-133891: Add missing error check to `SET_COUNT` macro in `_testinte… · miss-islington/cpython@7bd50e1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7bd50e1

Browse files
sobolevnmiss-islington
authored andcommitted
pythongh-133891: Add missing error check to SET_COUNT macro in _testinternalcapi.c (pythonGH-133892)
(cherry picked from commit cebae97) Co-authored-by: sobolevn <mail@sobolevn.me>
1 parent 890607f commit 7bd50e1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Modules/_testinternalcapi.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,6 +1045,9 @@ get_code_var_counts(PyObject *self, PyObject *_args, PyObject *_kwargs)
10451045
#define SET_COUNT(DICT, STRUCT, NAME) \
10461046
do { \
10471047
PyObject *count = PyLong_FromLong(STRUCT.NAME); \
1048+
if (count == NULL) { \
1049+
goto error; \
1050+
} \
10481051
int res = PyDict_SetItemString(DICT, #NAME, count); \
10491052
Py_DECREF(count); \
10501053
if (res < 0) { \

0 commit comments

Comments
 (0)
0