]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-139400: Make sure that parent parsers outlive their subparsers in `pyexpat` (...
authorSebastian Pipping <sebastian@pipping.org>
Sun, 5 Oct 2025 15:37:42 +0000 (17:37 +0200)
committerGitHub <noreply@github.com>
Sun, 5 Oct 2025 15:37:42 +0000 (17:37 +0200)
commit6edb2ddb5f3695cf4938979d645f31d7fba43ec8
treefdc1c21b47ad15bad1f42938f2ce0c9504e66850
parent13dc2fde8cec1e8aad04c7635b3da4ff3e3dcb00
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.
Lib/test/test_pyexpat.py
Misc/NEWS.d/next/Core_and_Builtins/2025-09-29-00-01-28.gh-issue-139400.X2T-jO.rst [new file with mode: 0644]
Modules/pyexpat.c