Skip to content

[3.14] gh-156939: Fix struct.pack('0p', bytes) (GH-157071) - #157130

Merged
vstinner merged 1 commit into
python:3.14from
miss-islington:backport-23525c9-3.14
Sep 7, 2026
Merged

[3.14] gh-156939: Fix struct.pack('0p', bytes) (GH-157071)#157130
vstinner merged 1 commit into
python:3.14from
miss-islington:backport-23525c9-3.14

Conversation

@miss-islington

@miss-islington miss-islington commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

If the Pascal string is empty (size=0), do not write the size prefix.
Previously, a NUL byte was written outsize the buffer (buffer
overflow). In practice, the write remains into allocated memory
and is silently ignored: no memory is corrupted.
(cherry picked from commit 23525c9)

Co-authored-by: Victor Stinner vstinner@python.org

If the Pascal string is empty (size=0), do not write the size prefix.
Previously, a NUL byte was written outsize the buffer (buffer
overflow). In practice, the write remains into allocated memory
and is silently ignored: no memory is corrupted.
(cherry picked from commit 23525c9)

Co-authored-by: Victor Stinner <vstinner@python.org>
@vstinner
vstinner enabled auto-merge (squash) September 7, 2026 19:33
@vstinner
vstinner merged commit 3a27a35 into python:3.14 Sep 7, 2026
51 checks passed
@miss-islington
miss-islington deleted the backport-23525c9-3.14 branch September 7, 2026 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants