Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-146065: Fix NULL dereference in FutureIter_am_send#146304

Open
VanshAgarwal24036 wants to merge 5 commits intopython:mainfrom
VanshAgarwal24036:gh-146065-fix-futureiter-null-deref
Open

gh-146065: Fix NULL dereference in FutureIter_am_send#146304
VanshAgarwal24036 wants to merge 5 commits intopython:mainfrom
VanshAgarwal24036:gh-146065-fix-futureiter-null-deref

Conversation

@VanshAgarwal24036
Copy link
Contributor

@VanshAgarwal24036VanshAgarwal24036 commentedMar 22, 2026
edited by bedevere-appbot
Loading

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.

Comment on lines +764 to +767
try:
it.throw(RuntimeError)
except RuntimeError:
pass
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Why do we silently suppress this exception here?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

The RuntimeError is intentionally triggered to clearit->future viaFutureIter_throw().

Copy link
Member

@picnixzpicnixzMar 22, 2026
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Then do not suppress it but eagerly catch it with assertRaises.

deftest_futureiter_send_after_throw_no_crash(self):
asyncdefrun_test():
loop=asyncio.get_event_loop()
fut=loop.create_future()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Alos I would suggest you use the _new_future() helper

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

i.e I do not think you need a wrapper and asyncio.run()

@bedevere-app
Copy link

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 phraseI have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@VanshAgarwal24036
Copy link
ContributorAuthor

I have made the requested changes; please review again

@bedevere-app
Copy link

Thanks for making the requested changes!

@picnixz: please review the changes made to this pull request.

@bedevere-appbedevere-appbot requested a review frompicnixzMarch 22, 2026 19:04
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@1st11st1Awaiting requested review from 1st11st1 is a code owner

@asvetlovasvetlovAwaiting requested review from asvetlovasvetlov is a code owner

@kumaraditya303kumaraditya303Awaiting requested review from kumaraditya303kumaraditya303 is a code owner

@willingcwillingcAwaiting requested review from willingcwillingc is a code owner

@picnixzpicnixzAwaiting requested review from picnixz

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@VanshAgarwal24036@picnixz

[8]ページ先頭

©2009-2026 Movatter.jp