bpo-35269: Fix a possible segfault involving a newly-created coroutine#10585
Conversation
coro->cr_origin wasn't initialized if compute_cr_origin() failed in PyCoro_New(), which would cause a crash during the coroutine's deallocation.
| Py_DECREF(coro); | ||
| return NULL; | ||
| } | ||
| ((PyCoroObject *)coro)->cr_origin = cr_origin; |
There was a problem hiding this comment.
The PR can be reduced to very trivial change: move this line before if (!cr_origin) {, do nothing else
There was a problem hiding this comment.
Sure, but I had wanted to use the opportunity to simplify the code.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
|
I have made the requested changes; please review again. |
|
Thanks for making the requested changes! @asvetlov: please review the changes made to this pull request. |
|
Thanks @ZackerySpytz for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7. |
pythonGH-10585) coro->cr_origin wasn't initialized if compute_cr_origin() failed in PyCoro_New(), which would cause a crash during the coroutine's deallocation. https://bugs.python.org/issue35269 (cherry picked from commit 062a57b) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
GH-10590 is a backport of this pull request to the 3.7 branch. |
GH-10585) coro->cr_origin wasn't initialized if compute_cr_origin() failed in PyCoro_New(), which would cause a crash during the coroutine's deallocation. https://bugs.python.org/issue35269 (cherry picked from commit 062a57b) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
|
Belated 👍, thanks @ZackerySpytz and @asvetlov for handling this! |
coro->cr_origin wasn't initialized if compute_cr_origin() failed in
PyCoro_New(), which would cause a crash during the coroutine's
deallocation.
https://bugs.python.org/issue35269