]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.10] gh-139400: Make sure that parent parsers outlive their subparsers in `pyexpat...
authorSebastian Pipping <sebastian@pipping.org>
Mon, 6 Oct 2025 23:34:14 +0000 (01:34 +0200)
committerGitHub <noreply@github.com>
Mon, 6 Oct 2025 23:34:14 +0000 (00:34 +0100)
commit8ea678d6d160d620e951b2c00484ab31c25dc4d3
tree718be564909e60941cc58b81166dfac1fb6f1142
parentf610f9eab929cb01598ccd27dea705c37e62d1da
[3.10] gh-139400: Make sure that parent parsers outlive their subparsers in `pyexpat` (GH-139403) (#139613)

* gh-139400: Make sure that parent parsers outlive their subparsers in `pyexpat` (#139403)

* Modules/pyexpat.c: Disallow collection of in-use parent parsers.

Within libexpat, a parser created via `XML_ExternalEntityParserCreate`
is relying on its parent parser throughout its entire lifetime.
Prior to this fix, is was possible for the parent parser to be
garbage-collected too early.

(cherry picked from commit 6edb2ddb5f3695cf4938979d645f31d7fba43ec8)

* Move news item to from section "Core and Builtins" to section "Security"
Lib/test/test_pyexpat.py
Misc/NEWS.d/next/Security/2025-09-29-00-01-28.gh-issue-139400.X2T-jO.rst [new file with mode: 0644]
Modules/pyexpat.c