-
Notifications
You must be signed in to change notification settings - Fork 92
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
Fix infinite loop caused by unclosed character ref #651
Conversation
Resolves scala#306 If parseCharRef is called for an unclosed character reference it will get caught in an infinite loop if the end of file is reached. Add a check to exit the loop when an EOF is encountered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -219,4 +219,15 @@ class UtilityTest { | |||
val x: Elem = <div>{Text(" My name ")}{Text(" is ")}{Text(" Harry ")}</div> | |||
assertEquals(<div>My name is Harry</div>, Utility.trim(x)) | |||
} | |||
|
|||
@Test | |||
def issue306InvalidUnclosedEntity(): Unit = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the name of the test method should be more specific: this is about character references, not entities in general...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for noticing that. I have updated the test method to use CharRef instead. I also created ticket #656 for the other infinite loop issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!!!
### What changes were proposed in this pull request? This pr aims to upgrade `scala-xml` from 2.1.0 to 2.2.0. ### Why are the changes needed? The new version bring some bug fix like: - scala/scala-xml#651 - scala/scala-xml#677 The full release notes as follows: - https://github.com/scala/scala-xml/releases/tag/v2.2.0 ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? - Pass GitHub Actions - Checked Scala 2.13, all Scala test passed: https://github.com/LuciferYang/spark/runs/15278359785 Closes #42119 from LuciferYang/scala-xml-220. Authored-by: yangjie01 <[email protected]> Signed-off-by: Sean Owen <[email protected]>
### What changes were proposed in this pull request? This pr aims to upgrade `scala-xml` from 2.1.0 to 2.2.0. ### Why are the changes needed? The new version bring some bug fix like: - scala/scala-xml#651 - scala/scala-xml#677 The full release notes as follows: - https://github.com/scala/scala-xml/releases/tag/v2.2.0 ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? - Pass GitHub Actions - Checked Scala 2.13, all Scala test passed: https://github.com/LuciferYang/spark/runs/15278359785 Closes apache#42119 from LuciferYang/scala-xml-220. Authored-by: yangjie01 <[email protected]> Signed-off-by: Sean Owen <[email protected]>
Resolves #306
If parseCharRef is called for an unclosed character reference it will get caught in an infinite loop if the end of file is reached. Add a check to exit the loop when an EOF is encountered.