bpo-32533: Fixed thread-safety of error handling in _ssl.#7158
bpo-32533: Fixed thread-safety of error handling in _ssl.#7158zooba merged 1 commit intopython:masterfrom
Conversation
|
|
||
| static inline _PySSLError _PySSL_errno(int failed, const SSL *ssl, int retcode) | ||
| { | ||
| _PySSLError err = { 0 }; |
There was a problem hiding this comment.
IIRC that's not safe in C code. You are allocating a struct on the stack and then return the stack allocated struct to the caller. Once you return to the caller, the stack allocated memory becomes invalid and may be reused in another function call.
There was a problem hiding this comment.
It returns a copy, not a pointer.
|
When you're done making the requested changes, leave the comment: |
|
I have made the requested changes; please review again (not really, but I answered the comment) |
|
Thanks for making the requested changes! @tiran: please review the changes made to this pull request. |
|
@tiran, will you time to review the changes you requested? |
|
Thanks @zooba for the PR 🌮🎉.. I'm working now to backport this PR to: 3.6, 3.7. |
) (cherry picked from commit c6fd1c1) Co-authored-by: Steve Dower <steve.dower@microsoft.com>
|
GH-9363 is a backport of this pull request to the 3.7 branch. |
|
Sorry, @zooba, I could not cleanly backport this to |
|
GH-9365 is a backport of this pull request to the 3.6 branch. |
https://bugs.python.org/issue32533