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

Fixing possible memory corruption in doc dictionary if node is moved between docs #268

Merged
merged 1 commit into from Aug 3, 2018

Conversation

Projects
None yet
2 participants
@weggerle-a
Contributor

weggerle-a commented Jul 30, 2018

etree.insert function tries to handle the case when a node is moved
between documents with the function moveNodeToDocument. So far the
source_doc is taken from the destination child node which is wrong.
The moveNodeToDocument function will not fix the names in the
document dictionaries because source and target doc are the same.

The fix takes now the source_doc from the node element which
should be inserted.

This fixes issue https://bugs.launchpad.net/lxml/+bug/1773749

Fixing possible memory corruption if node is moved between docs
etree.insert function tries to handle the case when a node is moved
between documents with the function moveNodeToDocument. So far the
source_doc is taken from the destination node which is wrong.
The moveNodeToDocument function will not fix the names in the
document dictionaries because source and target doc are the same.

The fix takes now the source_doc from the node element which
should be inserted.

This fixes issue https://bugs.launchpad.net/lxml/+bug/1773749
@scoder

This comment has been minimized.

Member

scoder commented Aug 3, 2018

Interesting bug. Thanks!

@scoder scoder merged commit 93f0c0d into lxml:master Aug 3, 2018

1 check failed

continuous-integration/travis-ci/pr The Travis CI build failed
Details

scoder added a commit that referenced this pull request Aug 3, 2018

@scoder

This comment has been minimized.

Member

scoder commented Aug 3, 2018

Fix released in lxml 4.2.4.

scoder added a commit that referenced this pull request Aug 3, 2018

@weggerle-a

This comment has been minimized.

Contributor

weggerle-a commented Aug 6, 2018

Thanks for the fast merge and new release!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment