Re: [xml] open libxml2 crash bugs in lxml's bug tracker



Stefan Behnel wrote:
Hi,

[SNIP]

https://bugs.launchpad.net/lxml/+bug/502959

-> segfault when parsing docbook XML with several external entities

diveintopython does not crash after define of missing entities.


a) It must be actual URL instead reference to unknown location
=======================
--- ./xml/diveintopython.xml.ORIG 2004-05-05 17:24:52.000000000 +0300
+++ ./xml/diveintopython.xml 2012-07-02 23:59:46.519332391 +0300
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
-"../../common/docbook/dtd/docbookx.dtd"
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd";
[
<!ENTITY % entities SYSTEM "entities.xml">
%entities;
=======================

b) xmllint warn for undefined entity .
So nbsp and ntilde should like below . I don't know for map , so I define it as function.
=======================
--- ./xml/entities.xml.ORIG 2004-05-09 01:13:26.000000000 +0300
+++ ./xml/entities.xml 2012-07-03 00:11:50.776304356 +0300
@@ -226,6 +226,8 @@
<!ENTITY url_xpcom "http://www.xprogramming.com/";>
<!ENTITY xpcom "XProgramming.com">

+<!ENTITY nbsp "&#160;">
+<!ENTITY ntilde "&#241;">
<!ENTITY pct "&#37;">
<!ENTITY singquot "&#39;">
<!ENTITY hash "&#35;">
@@ -263,6 +265,7 @@
<!ENTITY andor "<literal>and-or</literal>">
<!ENTITY candor "<literal><replaceable>bool</replaceable> ? <varname>a</varname> : <varname>b</varname></literal>">
<!ENTITY split "<function>split</function>">
+<!ENTITY map "<function>map</function>">
<!ENTITY join "<function>join</function>">
<!ENTITY info "<function>info</function>">
<!ENTITY type "<function>type</function>">
=======================



Roumen




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]