Fix infinite loop caused by unclosed character ref#651
Merged
dubinsky merged 2 commits intoscala:mainfrom Mar 27, 2023
Merged
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.
dubinsky
requested changes
Mar 26, 2023
| } | ||
|
|
||
| @Test | ||
| def issue306InvalidUnclosedEntity(): Unit = { |
Contributor
There was a problem hiding this comment.
Maybe the name of the test method should be more specific: this is about character references, not entities in general...
Contributor
Author
There was a problem hiding this comment.
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.
srowen
pushed a commit
to apache/spark
that referenced
this pull request
Jul 27, 2023
### 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 <yangjie01@baidu.com> Signed-off-by: Sean Owen <srowen@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.