-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
GH-97592: Fix crash in C remove_done_callback due to evil code #97660
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
Changes from all commits
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 |
---|---|---|
|
@@ -832,6 +832,21 @@ def __eq__(self, other): | |
|
||
fut.remove_done_callback(evil()) | ||
|
||
def test_remove_done_callbacks_list_clear(self): | ||
# see https://github.com/python/cpython/issues/97592 for details | ||
|
||
fut = self._new_future() | ||
fut.add_done_callback(str) | ||
|
||
for _ in range(63): | ||
fut.add_done_callback(id) | ||
|
||
class evil: | ||
def __eq__(self, other): | ||
fut.remove_done_callback(other) | ||
|
||
fut.remove_done_callback(evil()) | ||
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. All callbacks added by I'm not sure if we need to improve the return value of |
||
|
||
def test_schedule_callbacks_list_mutation_1(self): | ||
# see http://bugs.python.org/issue28963 for details | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Avoid a crash in the C version of :meth:`asyncio.Future.remove_done_callback` when an evil argument is passed. |
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.