From 671428d39f84197e984ca0898f16b0c567d77eba Mon Sep 17 00:00:00 2001 From: Leonid Dubinsky Date: Tue, 20 Jun 2023 16:06:46 -0400 Subject: [PATCH] mismatched quotes should not cause an infinite loop Resolves #656 --- .../scala/scala/xml/parsing/ConstructingParserTest.scala | 6 ++++++ .../main/scala/scala/xml/parsing/MarkupParserCommon.scala | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/jvm/src/test/scala/scala/xml/parsing/ConstructingParserTest.scala b/jvm/src/test/scala/scala/xml/parsing/ConstructingParserTest.scala index 1ee397e3..f796070d 100644 --- a/jvm/src/test/scala/scala/xml/parsing/ConstructingParserTest.scala +++ b/jvm/src/test/scala/scala/xml/parsing/ConstructingParserTest.scala @@ -91,4 +91,10 @@ class ConstructingParserTest { val parser: ConstructingParser = ConstructingParser.fromSource(Source.fromString(xml), preserveWS = true) parser.document().docElem // shouldn't crash } + + @Test(expected = classOf[scala.xml.parsing.FatalError]) + def issue656(): Unit = { + // mismatched quotes should not cause an infinite loop + XhtmlParser(Source.fromString("""