#2 Infinite loop loading XML document

open
nobody
None
5
2014-07-06
2003-09-11
Anonymous
No

I ran the supplied example jungle.py submitting a large
(2.5Mb) XML document. After Satine initialises, the app
goes into an infinite loop.

When I reran after deleting the following DTD from the
XML document, all ran OK.

It may be unusual in that it is a DTD that defines no
elements, only entities

<!DOCTYPE sss [

<!-- Portions Š International Organization for
Standardization 1986
Permission to copy in any form is granted for use with
conforming SGML systems and applications as
defined in
ISO 8879, provided this notice is included in all
copies.
-->
<!-- Character entity set. Typical invocation:
<!ENTITY % HTMLlat1 PUBLIC
"-//W3C//ENTITIES Latin 1//EN//HTML">
%HTMLlat1;
-->

<!ENTITY nbsp " ">

<!ENTITY iexcl "¡">
<!ENTITY cent "¢">
<!ENTITY pound "£">
<!ENTITY curren "¤">
<!ENTITY yen "¥">
<!ENTITY brvbar "¦">

<!ENTITY sect "§">
<!ENTITY uml "¨">

<!ENTITY copy "©">
<!ENTITY ordf "ª">
<!ENTITY laquo "«">

<!ENTITY not "¬">
<!ENTITY shy "­">

<!ENTITY reg "®">

<!ENTITY macr "¯">

<!ENTITY deg "°">
<!ENTITY plusmn "±">

<!ENTITY sup2 "²">

<!ENTITY sup3 "³">

<!ENTITY acute "´">

<!ENTITY micro "µ">
<!ENTITY para "¶">

<!ENTITY middot "·">

<!ENTITY cedil "¸">
<!ENTITY sup1 "¹">

<!ENTITY ordm "º">

<!ENTITY raquo "»">

<!ENTITY frac14 "¼">

<!ENTITY frac12 "½">

<!ENTITY frac34 "¾">

<!ENTITY iquest "¿">

<!ENTITY Agrave "À">

<!ENTITY Aacute "Á">

<!ENTITY Acirc "Â">

<!ENTITY Atilde "Ã">

<!ENTITY Auml "Ä">

<!ENTITY Aring "Å">

<!ENTITY AElig "Æ">

<!ENTITY Ccedil "Ç">

<!ENTITY Egrave "È">

<!ENTITY Eacute "É">

<!ENTITY Ecirc "Ê">

<!ENTITY Euml "Ë">

<!ENTITY Igrave "Ì">

<!ENTITY Iacute "Í">

<!ENTITY Icirc "Î">

<!ENTITY Iuml "Ï">

<!ENTITY ETH "Ð">
<!ENTITY Ntilde "Ñ">

<!ENTITY Ograve "Ò">

<!ENTITY Oacute "Ó">

<!ENTITY Ocirc "Ô">

<!ENTITY Otilde "Õ">

<!ENTITY Ouml "Ö">

<!ENTITY times "×">
<!ENTITY Oslash "Ø">

<!ENTITY Ugrave "Ù">

<!ENTITY Uacute "Ú">

<!ENTITY Ucirc "Û">

<!ENTITY Uuml "Ü">

<!ENTITY Yacute "Ý">

<!ENTITY THORN "Þ">

<!ENTITY szlig "ß">

<!ENTITY agrave "à">

<!ENTITY aacute "á">

<!ENTITY acirc "â">

<!ENTITY atilde "ã">

<!ENTITY auml "ä">

<!ENTITY aring "å">

<!ENTITY aelig "æ">

<!ENTITY ccedil "ç">

<!ENTITY egrave "è">

<!ENTITY eacute "é">

<!ENTITY ecirc "ê">

<!ENTITY euml "ë">

<!ENTITY igrave "ì">

<!ENTITY iacute "í">

<!ENTITY icirc "î">

<!ENTITY iuml "ï">

<!ENTITY eth "ð">
<!ENTITY ntilde "ñ">

<!ENTITY ograve "ò">

<!ENTITY oacute "ó">

<!ENTITY ocirc "ô">

<!ENTITY otilde "õ">

<!ENTITY ouml "ö">

<!ENTITY divide "÷">
<!ENTITY oslash "ø">

<!ENTITY ugrave "ù">

<!ENTITY uacute "ú">

<!ENTITY ucirc "û">

<!ENTITY uuml "ü">

<!ENTITY yacute "ý">

<!ENTITY thorn "þ">

<!ENTITY yuml "ÿ">

]>

The same document with the following inline DTD parses
OK:

<!--temporary parameter
entities -->
<!ENTITY % vartype "single |
multiple |
quantity |
character |
logical" >

<!-- TOP
LEVEL -->
<!--
========= --
>
<!-- -->
<!ELEMENT sss (date?, time?, origin?, user?, survey)>
<!ATTLIST sss version CDATA #REQUIRED
options CDATA #IMPLIED>

<!-- DOCUMENT
DESCRIPTION -->
<!--
====================
-->
<!-- -->
<!ELEMENT date (#PCDATA)>

<!ELEMENT time (#PCDATA)>

<!ELEMENT origin (#PCDATA)>

<!ELEMENT user (#PCDATA)>

<!-- -->
<!-- SURVEY
DESCRIPTION -->
<!--
==================
-->
<!-- -->
<!ELEMENT survey (title?, record)>

<!ELEMENT title (#PCDATA)>

<!-- -->
<!-- RECORD
DESCRIPTION -->
<!--
==================
-->
<!-- -->
<!ELEMENT record (variable+)>
<!ATTLIST record ident CDATA #REQUIRED>

<!-- -->
<!-- VARIABLE
DESCRIPTION -->
<!--
====================
-->
<!-- -->
<!ELEMENT variable (name, label, position,
((spread?, values) | size)?)>
<!ATTLIST variable ident CDATA #REQUIRED
TYPE (%vartype;) #REQUIRED>

<!ELEMENT name (#PCDATA)>

<!ELEMENT label (#PCDATA)>

<!ELEMENT position EMPTY>
<!ATTLIST position start CDATA #REQUIRED
finish CDATA #IMPLIED>

<!ELEMENT spread EMPTY>
<!ATTLIST spread subfields CDATA
#REQUIRED
width CDATA #IMPLIED>

<!-- -->
<!-- VALUES
DESCRIPTION -->
<!--
==================
-->
<!-- -->

<!ELEMENT values (value+ | (range, value*))
>

<!ELEMENT value (#PCDATA)>
<!ATTLIST value code CDATA #IMPLIED>

<!ELEMENT range EMPTY>
<!ATTLIST range from CDATA #REQUIRED
to CDATA #REQUIRED>

<!ELEMENT size (#PCDATA)>

<!-- -->
<!-- END OF DOCUMENT TYPE
DEFINITION -->

Discussion