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

* 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 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