Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit cebae97

Browse files
authoredMay 31, 2025··
gh-133891: Add missing error check to SET_COUNT macro in _testinternalcapi.c (#133892)
1 parent 3704171 commit cebae97

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)
Please sign in to comment.

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant