-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
[Skip Issue] Fix some minor bugs in _elementtree.c #10060
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
[Skip Issue] Fix some minor bugs in _elementtree.c #10060
Conversation
@@ -3338,7 +3339,6 @@ _elementtree_XMLParser___init___impl(XMLParserObject *self, PyObject *target, | |||
if (!target) { | |||
Py_CLEAR(self->entity); | |||
Py_CLEAR(self->names); | |||
EXPAT(ParserFree)(self->parser); |
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.
Why this is removed?
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.
self->parser
would be freed again during deallocation, which would cause a crash.
Thanks @ZackerySpytz for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 2.7, 3.6, 3.7. |
GH-10066 is a backport of this pull request to the 3.7 branch. |
References could leak, NULL could be dereferenced, and the Expat parser could be double freed when some errors raised. (cherry picked from commit 9f3ed3e) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
GH-10067 is a backport of this pull request to the 3.6 branch. |
Sorry, @ZackerySpytz and @serhiy-storchaka, I could not cleanly backport this to |
References could leak, NULL could be dereferenced, and the Expat parser could be double freed when some errors raised. (cherry picked from commit 9f3ed3e) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Thank you @ZackerySpytz. Nice patch. Perhaps some bugs exist in 2.7 too, but sources are too different for automatic merge. Do you mind to make a backport manually if it is necessary? |
References could leak, NULL could be dereferenced, and the Expat parser could be double freed when some errors raised. (cherry picked from commit 9f3ed3e) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
References could leak, NULL could be dereferenced, and the Expat parser could be double freed when some errors raised. (cherry picked from commit 9f3ed3e) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
I will create a backport to 2.7, Serhiy. |
Don't leak a reference if PyDict_Update() fails, check the PyList_New() call in treebuilder_new(), and properly handle failures in xmlparser(). (cherry picked from commit 9f3ed3e)
GH-10080 is a backport of this pull request to the 2.7 branch. |
Hi! The buildbot x86 Windows XP VS9.0 2.7 has failed when building commit e131c7c. You can take a look here: |
No description provided.