Segfault when target object defines doctype() and document contains invalid doctype
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxml |
Fix Released
|
High
|
scoder |
Bug Description
Invalid doctypes such as <!DOCTYPE "html"> and <!DOCTYPE> cause lxml's target parser interface to segfault if the target object defines the doctype() method.
Backtrace and executable script are attached.
Valid doctypes will not cause a segfault; nor will a target object that does not define doctype().
I've reproduced the problem on Python 2.7 and Python 3.2, using both XMLParser and HTMLParser.
Version info:
---
Python : sys.version_
lxml.etree : (2, 3, 0, 0)
libxml used : (2, 7, 8)
libxml compiled : (2, 7, 8)
libxslt used : (1, 1, 26)
libxslt compiled : (1, 1, 26)
---
Python : sys.version_
lxml.etree : (2, 3, 0, 0)
libxml used : (2, 7, 8)
libxml compiled : (2, 7, 8)
libxslt used : (1, 1, 26)
libxslt compiled : (1, 1, 26)
---
Changed in lxml: | |
milestone: | none → 2.3.x |
Thanks for the report. Here is a fix:
https:/ /github. com/lxml/ lxml/commit/ e1f3f2affc774fd aaf414f59e2601c 298b33f954