]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.12] gh-111784: Fix two segfaults in the elementtree module (GH-113405) (GH-113446)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 24 Dec 2023 09:25:05 +0000 (10:25 +0100)
committerGitHub <noreply@github.com>
Sun, 24 Dec 2023 09:25:05 +0000 (09:25 +0000)
commit15ea4a429245ddb9d919757308777521f61c681c
tree779ef5f3d571eeba95290746f9fa96e564a3462e
parent7f2ebc84e8066e2c51feb6ef6403360922bbc0aa
[3.12] gh-111784: Fix two segfaults in the elementtree module (GH-113405) (GH-113446)

First fix resolve situation when pyexpat module (which contains expat_CAPI
capsule) deallocates before _elementtree, so we need to hold a strong
reference to pyexpat module to.

Second fix resolve situation when module state is deallocated before
deallocation of XMLParser instances, which uses module state to clear
some stuff.
(cherry picked from commit 894f0e573d9eb49cd5864c44328f10a731852dab)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Misc/NEWS.d/next/Library/2023-12-23-13-10-42.gh-issue-111784.Nb4L1j.rst [new file with mode: 0644]
Modules/_elementtree.c