-
-
Couldn't load subscription status.
- Fork 33.2k
gh-140593: Fix a memory leak in function my_ElementDeclHandler of pyexpat
#140602
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modulo the test refactoring.
|
How bad is it when the model is leaked? I see that you can leak only few bytes per bad call, so to cause a DoS you'll likely need many calls to blow-up the memory (and probably specific inputs) but I don't know which information is actually being leaked. |
|
@picnixz hi!
I know modulo but do not understand this statement. What do you mean? |
|
Sorry, job conditioning :) I meant "let's merge this once you've addressed the comments about the tests you added". |
I'm not in support of this - readability goes down - but it was requested.
@picnixz that is my impression too. So it's a bug but likely without attack surface.
The so-called content model. I adjusted in-test comments now realizing that the "32 to 56" bytes was due to the precise test and could be more depending on the input XML content. |
|
@picnixz thanks for the review! 🙏 |
Thanks. So I'll only backport this up to 3.13. |
…` of `pyexpat` (pythonGH-140602) Ensure that the memory allocated for the content model passed to `my_ElementDeclHandler` is freed in all error paths. (cherry picked from commit e34a5e3) Co-authored-by: Sebastian Pipping <sebastian@pipping.org>
…` of `pyexpat` (pythonGH-140602) Ensure that the memory allocated for the content model passed to `my_ElementDeclHandler` is freed in all error paths. (cherry picked from commit e34a5e3) Co-authored-by: Sebastian Pipping <sebastian@pipping.org>
|
GH-140624 is a backport of this pull request to the 3.14 branch. |
|
GH-140625 is a backport of this pull request to the 3.13 branch. |
…Handler` of `pyexpat` (pythonGH-140602) Ensure that the memory allocated for the content model passed to `my_ElementDeclHandler` is freed in all error paths. (cherry picked from commit e34a5e3) Co-authored-by: Sebastian Pipping <sebastian@pipping.org>
|
GH-140629 is a backport of this pull request to the 3.14 branch. |
1 similar comment
|
GH-140629 is a backport of this pull request to the 3.14 branch. |
…Handler` of `pyexpat` (pythonGH-140602) Ensure that the memory allocated for the content model passed to `my_ElementDeclHandler` is freed in all error paths. (cherry picked from commit e34a5e3) Co-authored-by: Sebastian Pipping <sebastian@pipping.org>
|
GH-140630 is a backport of this pull request to the 3.13 branch. |
CC @StanFromIreland @YuanchengJiang
my_ElementDeclHandlerofpyexpat#140593