[xml] Nasty DTD parsing bug (IO buffering, perhaps?)


Here is a DTD parsing bug in libxml2 (tested with 2.6.27).

Download the following .tar.gz:


Unpack it and run:

    $ xmllint --loaddtd bug.xml

You will get lots of error messages, the first one being:

    nlm/references.ent:381: parser error : Comment not terminated

However if you look at the file, you will see that is nonsense, and there are no unterminated comments on line 381.

Even worse, if you delete *one character* from the references.ent file at *any point* before line 381, then everything works fine!

This appears to be some kind of IO buffering error or something like that, as the parser seems to be dependent on how many characters are in the file before that point.

Best regards,


Print XML with Prince!

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