Skip to content
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

Add check for c_src_dict in _fixThreadDictPtr #229

Merged
merged 1 commit into from
Mar 18, 2017
Merged

Add check for c_src_dict in _fixThreadDictPtr #229

merged 1 commit into from
Mar 18, 2017

Conversation

tbodt
Copy link
Contributor

@tbodt tbodt commented Feb 26, 2017

If a document is created outside of LXML and converted to an LXML node with elementFactory, its dictionary might be NULL, which would make xmlDictOwns return -1, which counts as true. If the nodes in that document are then moved to an LXML document, fixThreadDictNsForNode would then set the href and prefix pointers to point to the dictionary, which would cause a bad free when the document gets freed.

If a document is created outside of LXML and converted to an LXML node with elementFactory, its dictionary might be NULL, which would make xmlDictOwns return -1, which counts as true. If the nodes in that document are then moved to an LXML document, fixThreadDictNsForNode would then set the href and prefix pointers to point to the dictionary, which would cause a bad free when the document gets freed.
@scoder
Copy link
Member

scoder commented Mar 18, 2017

Thanks!

@scoder scoder merged commit fd9cf96 into lxml:master Mar 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants