Skip to content

OOM on malformed input #35

Closed
Closed
@fhars

Description

@fhars
Welcome to Scala version 2.11.2 (OpenJDK 64-Bit Server VM, Java 1.7.0_65).
Type in expressions to have them evaluated.
Type :help for more information.

scala> import scala.xml.pull._
import scala.xml.pull._

scala> import scala.io.Source
import scala.io.Source

scala> val r = new XMLEventReader(Source.fromString("<broken attribute='is truncated") )
[error] (XMLEventReader) java.lang.OutOfMemoryError: Java heap space

ch returns 0.asInstancsOf[Char] every time it is called, while MarkupParserCommon.xAttributeValue loops until ch returns endCh, happily appending all the zeros to its internal string buffer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions