gh-151295: Fix use-after-free in bytes.join()/bytearray.join() via re… · python/cpython@84a322a · GitHub
Skip to content

Commit 84a322a

Browse files
authored
gh-151295: Fix use-after-free in bytes.join()/bytearray.join() via re-entrant __buffer__ (GH-151296)
1 parent 84630e2 commit 84a322a

3 files changed

Lines changed: 35 additions & 0 deletions

File tree

Lib/test/test_bytes.py

Lines changed: 26 additions & 0 deletions
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Fixed a crash (use-after-free) in :meth:`bytes.join` and
2+
:meth:`bytearray.join` that could occur if an item's
3+
:meth:`~object.__buffer__` concurrently mutates the sequence being joined.
4+
The mutation is now reported as a :exc:`RuntimeError` instead.

Objects/stringlib/join.h

Lines changed: 5 additions & 0 deletions

0 commit comments

Comments
 (0)