lxml - the Python XML toolkit

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

Reported by Leonard Richardson on 2012-04-18
38
This bug affects 5 people
Affects Status Importance Assigned to Milestone
lxml
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)
---

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

This has been fixed in lxml 2.3.5.

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

Other bug subscribers