https://github.com/python/cpython/commit/a8708f7320d1d752c92678043278cd75d97250d8
commit: a8708f7320d1d752c92678043278cd75d97250d8
branch: 3.14
author: Miss Islington (bot) <31488909+miss-isling...@users.noreply.github.com>
committer: sobolevn <m...@sobolevn.me>
date: 2025-05-31T21:57:52Z
summary:

[3.14] gh-133891: Add missing error check to `SET_COUNT` macro in 
`_testinternalcapi.c` (GH-133892) (#134988)

gh-133891: Add missing error check to `SET_COUNT` macro in 
`_testinternalcapi.c` (GH-133892)
(cherry picked from commit cebae977a63f32c3c03d14c040df3cea55b8f585)

Co-authored-by: sobolevn <m...@sobolevn.me>

files:
M Modules/_testinternalcapi.c

diff --git a/Modules/_testinternalcapi.c b/Modules/_testinternalcapi.c
index 136e6a7a015049..845c218e679ad2 100644
--- a/Modules/_testinternalcapi.c
+++ b/Modules/_testinternalcapi.c
@@ -1045,6 +1045,9 @@ get_code_var_counts(PyObject *self, PyObject *_args, 
PyObject *_kwargs)
 #define SET_COUNT(DICT, STRUCT, NAME) \
     do { \
         PyObject *count = PyLong_FromLong(STRUCT.NAME); \
+        if (count == NULL) { \
+            goto error; \
+        } \
         int res = PyDict_SetItemString(DICT, #NAME, count); \
         Py_DECREF(count); \
         if (res < 0) { \

_______________________________________________
Python-checkins mailing list -- python-checkins@python.org
To unsubscribe send an email to python-checkins-le...@python.org
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: arch...@mail-archive.com

Reply via email to