Segfault when target object defines doctype() and document contains invalid doctype

Bug #984936 reported by Leonard Richardson
38
This bug affects 5 people
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_info(major=2, minor=7, micro=1, releaselevel='final', serial=0)
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_info(major=3, minor=2, micro=0, releaselevel='final', serial=0)
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)
---

Revision history for this message
Leonard Richardson (leonardr) wrote :
Revision history for this message
Leonard Richardson (leonardr) wrote :
Revision history for this message
scoder (scoder) wrote :
Changed in lxml:
assignee: nobody → Stefan Behnel (scoder)
importance: Undecided → High
status: New → Fix Committed
Revision history for this message
scoder (scoder) wrote :

This has been fixed in lxml 2.3.5.

Changed in lxml:
status: Fix Committed → Fix Released
scoder (scoder)
Changed in lxml:
milestone: none → 2.3.x
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.