-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
gh-83004: Harden msvcrt init #103383
gh-83004: Harden msvcrt init #103383
Conversation
erlend-aasland
commented
Apr 8, 2023
•
edited by bedevere-bot
Loading
edited by bedevere-bot
- Issue: Improve stdlib module initialization error handling. #83004
Darn, I forgot to add error handling for |
if (version == NULL) { | ||
goto error; | ||
} | ||
st = PyModule_AddObjectRef(m, "CRT_ASSEMBLY_VERSION", version); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@erlend-aasland Just FYI, the modsupport functions allow passing in NULL
provided an error has already occurred, and they just let it chain. So the code here was fine before.
No need to revert now though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL! Sorry for not waiting on your review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However, there was a leak if PyModule_AddObject failed, since that API only eat refs if successful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I should have been more careful in this.