Skip to content

gh-156939: Detect PyBytesWriter buffer overflow earlier - #157385

Merged
vstinner merged 3 commits into
python:mainfrom
vstinner:check_canary
Sep 13, 2026
Merged

vstinner merged 3 commits into
python:mainfrom
vstinner:check_canary

Conversation

@vstinner

@vstinner vstinner commented Sep 13, 2026 •

Copy link
Copy Markdown
Member

Check the canary byte in all PyBytesWriter methods, not only in PyBytesWriter_Finish().

Add a discard() method to the _testcapi wrapper.

Check the canary byte in all PyBytesWriter methods, not only in
PyBytesWriter_Finish().

Add a discard() method to the _testcapi wrapper.
@vstinner
vstinner merged commit 58cdff7 into python:main Sep 13, 2026
51 checks passed
@vstinner
vstinner deleted the check_canary branch September 13, 2026 03:47
johnslavik pushed a commit to johnslavik/cpython that referenced this pull request Sep 14, 2026
…#157385)

Check the canary byte in all PyBytesWriter methods, not only in
PyBytesWriter_Finish().

Add a discard() method to the _testcapi wrapper.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

1 participant