Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
sobolevn opened this issue May 11, 2025 · 0 comments
Open

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

sobolevn opened this issue May 11, 2025 · 0 comments
Assignees
Labels
extension-modules C modules in the Modules dir type-bug An unexpected behavior, bug, or error

Comments

@sobolevn
Copy link
Member

sobolevn commented May 11, 2025

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

@sobolevn sobolevn self-assigned this May 11, 2025
@sobolevn sobolevn added type-bug An unexpected behavior, bug, or error extension-modules C modules in the Modules dir labels May 11, 2025
sobolevn added a commit to sobolevn/cpython that referenced this issue May 11, 2025
@sobolevn sobolevn changed the title Missing error handling in Missing error handling in SET_COUNT macro in _testinternalcapi.c May 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension-modules C modules in the Modules dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant