Re: [xml] [Bug]: Extensive memory usage on invalid documents



On Wed, Oct 17, 2001 at 09:22:39PM +0200, Melvyn Sopacua wrote:
Hi all,

With the help of the Zen community at #AxKit we established quite a sensere 
bug,
when validating an XML document. I first encountered this, when using the perl
module, but after testing with xmllint --valid or --postvalid, it became 
clear that
the bug is in LibXML itself.

  Seems a bug in the validation state machine. Reproductible with a
stripped down version of your document:

-----------------------------------------------------------
<!DOCTYPE body [
<!ELEMENT body (block* | p | h6 | hl1 | hl2 | table | ol | ul | dl | bq | fn | note | pre | hr | h6* | a*)+>
<!ELEMENT block (#PCDATA)>
<!ELEMENT p (#PCDATA)>
<!ELEMENT h6 (#PCDATA)>
<!ELEMENT hl1 (#PCDATA)>
<!ELEMENT hl2 (#PCDATA)>
<!ELEMENT table (#PCDATA)>
<!ELEMENT ol (#PCDATA)>
<!ELEMENT ul (#PCDATA)>
<!ELEMENT dl (#PCDATA)>
<!ELEMENT bq (#PCDATA)>
<!ELEMENT fn (#PCDATA)>
<!ELEMENT note (#PCDATA)>
<!ELEMENT pre (#PCDATA)>
<!ELEMENT hr (#PCDATA)>
<!ELEMENT a (#PCDATA)>
<!ELEMENT li (#PCDATA)>
<!ELEMENT strong (#PCDATA)>
]>
<body><p/><li/><strong/><li/><strong/><li/><li/><p/></body>
-----------------------------------------------------------

  I will work on fixing it.

Note that if can be removed by changing your DTD to

<!ELEMENT body (block | %block-content; | h6 | a)+>
instead of
<!ELEMENT body (block* | %block-content; | h6* | a*)+>

in the meantime,

Daniel

-- 
Daniel Veillard      | Red Hat Network http://redhat.com/products/network/
veillard redhat com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



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