Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OOM on malformed input #35

Closed
fhars opened this issue Nov 25, 2014 · 1 comment
Closed

OOM on malformed input #35

fhars opened this issue Nov 25, 2014 · 1 comment
Milestone

Comments

@fhars
Copy link

fhars commented Nov 25, 2014

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.

@adriaanm adriaanm added this to the 1.0.4 milestone Dec 4, 2014
@som-snytt
Copy link
Contributor

Fixed by #44 ?

ashawley added a commit to ashawley/scala-xml that referenced this issue Feb 15, 2016
* src/test/scala/scala/xml/XMLTest.scala (issue35): New test.

* src/test/scala/scala/xml/pull/XMLEventReaderTest.scala
(issue35): New test.
ashawley pushed a commit to ashawley/scala-xml that referenced this issue Feb 15, 2016
* src/main/scala/scala/xml/parsing/MarkupParserCommon.scala
(xAttributeValue): Check for eof in while loop.
This was referenced Feb 15, 2016
biswanaths pushed a commit that referenced this issue Apr 21, 2016
* src/test/scala/scala/xml/XMLTest.scala (issue35): New test.

* src/test/scala/scala/xml/pull/XMLEventReaderTest.scala
(issue35): New test.
biswanaths pushed a commit that referenced this issue Apr 21, 2016
* src/test/scala/scala/xml/XMLTest.scala (issue35): New test.

* src/test/scala/scala/xml/pull/XMLEventReaderTest.scala
(issue35): New test.
biswanaths pushed a commit that referenced this issue Apr 21, 2016
* src/main/scala/scala/xml/parsing/MarkupParserCommon.scala
(xAttributeValue): Check for eof in while loop.
biswanaths pushed a commit that referenced this issue Apr 21, 2016
* src/test/scala/scala/xml/XMLTest.scala (issue35): New test.

* src/test/scala/scala/xml/pull/XMLEventReaderTest.scala
(issue35): New test.
biswanaths pushed a commit that referenced this issue Apr 21, 2016
* src/main/scala/scala/xml/parsing/MarkupParserCommon.scala
(xAttributeValue): Check for eof in while loop.
shimamoto added a commit to shimamoto/scala-xml that referenced this issue Apr 27, 2016
This commit make up for the lack of scala#35. Specifically,
CDATA sections, comment, DTD.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants