gh-146065: Fix NULL dereference in FutureIter_am_send#146304
gh-146065: Fix NULL dereference in FutureIter_am_send#146304VanshAgarwal24036 wants to merge 6 commits intopython:mainfrom
Conversation
|
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! @picnixz: please review the changes made to this pull request. |
|
I was able to reproduce and verify this fix locally on macOS (x86_64). Without the fix ( With the fix ( |
vstinner
left a comment
There was a problem hiding this comment.
LGTM.
I confirm that test_futureiter_send_after_throw_no_crash() does crash without the fix, and pass with the fix.
@kumaraditya303: Do you want to double check this fix? I didn't work on ayncio recently, and I'm not 100% sure if raising StopIteration is the correct behavior in this case.
Misc/NEWS.d/next/Library/2026-03-23-00-04-13.gh-issue-146065.FIdn8D.rst
Outdated
Show resolved
Hide resolved
…Idn8D.rst Co-authored-by: Victor Stinner <vstinner@python.org>
After throw() or close(), it->future can be NULL. A subsequent send() call would dereference it and crash. This adds a NULL check and raises StopIteration instead.
NULLpointer dereference inFutureIter_am_send#146065