-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
gh-143756: Avoid borrowed reference in SSL code #143816
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
base: main
Are you sure you want to change the base?
Conversation
GET_SOCKET() returned a borrowed reference, which was potentially unsafe. Also, refactor out some common code.
| get_socket(PySSLSocket *obj, PySocketSockObject **out_sock, | ||
| const char *filename, int lineno) |
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.
It would significantly simplify usage if this were a macro that automatically passed __FILE__ and __LINE__.
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.
If we have a macro, AFAIR, it expands to something that will not be visually helpful (on the IDE the reported line would mismatch, but I may be wrong here).
So we also could well remove all file/lineno reports and add a description of what we were doing instead, or the involved function.
The file/lineno is only for us to know what happened when someone reports a bug. But the file is likely to always be the same...
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.
The design choices of this module are hard to comply with but well... better to have small changes for now.
GET_SOCKET() returned a borrowed reference, which was potentially unsafe with free threading. Also, refactor out some common code.