gh-142829: Fix use-after-free in `Context.__eq__` via re-entrant `Con… · python/cpython@a4086d7 · GitHub
Skip to content

Commit a4086d7

Browse files
gh-142829: Fix use-after-free in Context.__eq__ via re-entrant ContextVar.set (#142905)
1 parent a9ca49d commit a4086d7

3 files changed

Lines changed: 55 additions & 5 deletions

File tree

Lib/test/test_context.py

Lines changed: 30 additions & 0 deletions
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Fix a use-after-free crash in :class:`contextvars.Context` comparison when a
2+
custom ``__eq__`` method modifies the context via
3+
:meth:`~contextvars.ContextVar.set`.

Python/hamt.c

Lines changed: 22 additions & 5 deletions

0 commit comments

Comments
 (0)