scala-xml
scala-xml copied to clipboard
Infinite loop caused by unclosed character ref in MarkupParser#content
Putting an unclosed character ref (&#
) in XML causes an infinite loop.
Example code:
import scala.io.Source
import scala.xml.parsing.XhtmlParser
val text = "<html><body>test &# test </body></html>"
XhtmlParser(Source.fromString(text))
Thanks for reporting this. I'm seeing this in version 1.2.0 and as far back as 1.0.6. Some of this code was recently changed to fix similar defects in 1.1.1. I thought this might be a regression in the 1.1.1 changes, but it appears not.
This in XML is also causing an infinite loop:
myAttribute=`value"
Note that the quotes are mis-matched.