Skip to content

[3.14] gh-156939: Fix xmlcharrefreplace() buffer overflow (GH-157109) - #157233

Merged
vstinner merged 2 commits into
python:3.14from
miss-islington:backport-9398655-3.14
Sep 14, 2026
Merged

vstinner merged 2 commits into
python:3.14from
miss-islington:backport-9398655-3.14

Conversation

@miss-islington

@miss-islington miss-islington commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Write into a temporary buffer to not write the trailing NUL byte
into the writer. Previously, the NUL byte was written outsize
the writer buffer.
(cherry picked from commit 9398655)

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

…7109)

Write into a temporary buffer to not write the trailing NUL byte
into the writer. Previously, the NUL byte was written outsize
the writer buffer.
(cherry picked from commit 9398655)

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

Copy link
Copy Markdown
Member

@vstinner this is broken on older branches.

@vstinner

vstinner commented Sep 10, 2026 •

Copy link
Copy Markdown
Member

@StanFromIreland:

@vstinner this is broken on older branches.

Oh thanks for the ping, I didn't pay attention if this backport was merged or not.

Objects/unicodeobject.c:966:25: error: ‘_Py_MAX_UNICODE’ undeclared (first use in this function); did you mean ‘MAX_UNICODE’?

The compiler hint is correct, 3.14 uses MAX_UNICODE. I pushed a change.

@vstinner
vstinner merged commit 5d1f8ae into python:3.14 Sep 14, 2026
47 checks passed
@miss-islington
miss-islington deleted the backport-9398655-3.14 branch September 14, 2026 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants