Skip to content
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

socketmodule.c does not handle errors on module creation extension-modules #111253

Closed
sobolevn opened this issue Oct 24, 2023 · 1 comment
Closed
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 Oct 24, 2023

Bug report

It handles most with a specialized macro:

cpython/Modules/socketmodule.c

Lines 7716 to 7722 in 81eba76

/* Kernel event messages */
#ifdef PF_SYSTEM
ADD_INT_MACRO(m, PF_SYSTEM);
#endif
#ifdef AF_SYSTEM
ADD_INT_MACRO(m, AF_SYSTEM);
#endif

but not these ones:

cpython/Modules/socketmodule.c

Lines 7724 to 7731 in 81eba76

/* FreeBSD divert(4) */
#ifdef PF_DIVERT
PyModule_AddIntMacro(m, PF_DIVERT);
#endif
#ifdef AF_DIVERT
PyModule_AddIntMacro(m, AF_DIVERT);
#endif

Introduced in #96536

Linked PRs

@sobolevn sobolevn added type-bug An unexpected behavior, bug, or error extension-modules C modules in the Modules dir labels Oct 24, 2023
@sobolevn sobolevn self-assigned this Oct 24, 2023
sobolevn added a commit to sobolevn/cpython that referenced this issue Oct 24, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Oct 25, 2023
…111254)

(cherry picked from commit 3052c09)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
vstinner pushed a commit that referenced this issue Nov 1, 2023
… (#111299)

gh-111253: Fix error checking in _socket module init (GH-111254)
(cherry picked from commit 3052c09)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
@vstinner
Copy link
Member

vstinner commented Nov 1, 2023

Fixed in 3.12 and main branches.

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

2 participants