]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-133891: Add missing error check to `SET_COUNT` macro in `_testinternalcapi.c`...
authorsobolevn <mail@sobolevn.me>
Sat, 31 May 2025 21:33:02 +0000 (00:33 +0300)
committerGitHub <noreply@github.com>
Sat, 31 May 2025 21:33:02 +0000 (00:33 +0300)
Modules/_testinternalcapi.c

index 136e6a7a01504924d8c17ed3581ca32eb6a9dc76..845c218e679ad249da32a71379c57bc230630054 100644 (file)
@@ -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) { \