-
-
Notifications
You must be signed in to change notification settings - Fork 37.1k
gh-146065: Fix NULL dereference in FutureIter_am_send #146304
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?
Changes from all commits
faef7f1
45942d6
8d80510
a410938
0128198
dafe523
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| Fix a crash in asyncio.Future iterator when send() is | ||
| called after throw() or close(). |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1872,6 +1872,11 @@ FutureIter_am_send(PyObject *op, | |
| PyObject **result) | ||
| { | ||
| futureiterobject *it = (futureiterobject*)op; | ||
| if (it->future == NULL) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This was the previous reviewer's @kumaraditya303 review comment. There is also a read happening in After reading @VanshAgarwal24036, I noticed the PR has become state. Would you like to revive it again with these change ? |
||
| PyErr_SetNone(PyExc_StopIteration); | ||
| *result = NULL; | ||
| return PYGEN_ERROR; | ||
| } | ||
| /* arg is unused, see the comment on FutureIter_send for clarification */ | ||
| PySendResult res; | ||
| Py_BEGIN_CRITICAL_SECTION(it->future); | ||
|
|
||
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.
We need to have an additional test case for the
it.close()similar to this.