gh-140593: Fix a memory leak in function my_ElementDeclHandler of pyexpat#140602
gh-140593: Fix a memory leak in function my_ElementDeclHandler of pyexpat#140602picnixz merged 7 commits intopython:mainfrom
my_ElementDeclHandler of pyexpat#140602Conversation
|
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 <[email protected]>
…` 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 <[email protected]>
|
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 <[email protected]>
|
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 <[email protected]>
|
GH-140630 is a backport of this pull request to the 3.13 branch. |
…` of `pyexpat` (python#140602) Ensure that the memory allocated for the content model passed to `my_ElementDeclHandler` is freed in all error paths.
CC @StanFromIreland @YuanchengJiang
my_ElementDeclHandlerofpyexpat#140593