gh-148735: Fix a UAF in Element.findtext()#148738
gh-148735: Fix a UAF in Element.findtext()#148738StanFromIreland merged 3 commits intopython:mainfrom
Element.findtext()#148738Conversation
`Element.findtext()`
picnixz
left a comment
There was a problem hiding this comment.
All the occurrences you change are of the form (get borrowed) followed by (incref) right? if so, it is ok to change it to (get strong ref) but otherwise we may have un-necessary incref/decref. Currently XML is not FT-safe but if we (I) want to make it so, we should avoid incref/decref in hot paths
The number of incerfs/decrefs remains the same. They are not unnecessary. |
|
Yeah I was not sure about this as I am on mobile. Thanks for checking |
|
Thanks @StanFromIreland for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
|
Sorry, @StanFromIreland, I could not cleanly backport this to |
|
GH-148916 is a backport of this pull request to the 3.14 branch. |
|
Thanks for the reviews! |
|
GH-148923 is a backport of this pull request to the 3.13 branch. |
This was a regression introduced by c57623c.
cpython/Modules/_elementtree.c
Line 575 in ae55e9c
Element.findtext()when tag__eq__mutates parent #148735