Skip to content

[3.14] gh-146196: Fix Undefined Behavior in _PyUnicodeWriter_WriteASCIIString() (#146201)#146220

Merged
vstinner merged 1 commit intopython:3.14from
vstinner:ascii14
Mar 20, 2026
Merged

[3.14] gh-146196: Fix Undefined Behavior in _PyUnicodeWriter_WriteASCIIString() (#146201)#146220
vstinner merged 1 commit intopython:3.14from
vstinner:ascii14

Conversation

@vstinner
Copy link
Member

@vstinner vstinner commented Mar 20, 2026

Avoid calling memcpy(data + writer->pos, NULL, 0)
which has an undefined behavior.

(cherry picked from commit cd10a2e)

…IString() (python#146201)

Avoid calling memcpy(data + writer->pos, NULL, 0)
which has an undefined behavior.

Co-authored-by: Victor Stinner <vstinner@python.org>
(cherry picked from commit cd10a2e)
@vstinner vstinner enabled auto-merge (squash) March 20, 2026 16:02
@vstinner vstinner merged commit 6e73225 into python:3.14 Mar 20, 2026
49 checks passed
@vstinner vstinner deleted the ascii14 branch March 20, 2026 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants