Skip to content

Missing error handling in SET_COUNT macro in _testinternalcapi.c #133891

Closed
@sobolevn

Description

@sobolevn

Bug report

Refs #133265

Right here PyLong_FromLong can in theory (unlikely in practice) return NULL. It is missing this check. I understand that this is a test code, but I also don't see a reason why we should not be explicit about it.

#define SET_COUNT(DICT, STRUCT, NAME) \

cc @ericsnowcurrently

I have a PR ready.

Linked PRs

Activity

self-assigned this
on May 11, 2025
added a commit that references this issue on May 11, 2025

pythongh-133891: Add missing error check to `SET_COUNT` macro in `_te…

69b8adf
changed the title [-]Missing error handling in[/-] [+]Missing error handling in `SET_COUNT` macro in `_testinternalcapi.c`[/+] on May 11, 2025
added a commit that references this issue on May 31, 2025

gh-133891: Add missing error check to `SET_COUNT` macro in `_testinte…

cebae97
added a commit that references this issue on May 31, 2025

pythongh-133891: Add missing error check to `SET_COUNT` macro in `_te…

added a commit that references this issue on May 31, 2025

[3.14] gh-133891: Add missing error check to `SET_COUNT` macro in `_t…

a8708f7
added
3.14bugs and security fixes
3.15new features, bugs and security fixes
on May 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

3.14bugs and security fixes3.15new features, bugs and security fixesextension-modulesC modules in the Modules dirtype-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Missing error handling in `SET_COUNT` macro in `_testinternalcapi.c` · Issue #133891 · python/cpython

    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