Skip to content

Conversation

@mike-mcgann
Copy link
Contributor

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.

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.
Copy link
Contributor

@dubinsky dubinsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once this merges, #306 will close; there is a comment there about a different infinite loop - would you mind extracting it into a separate issue so that it is not lost? Thank you!

}

@Test
def issue306InvalidUnclosedEntity(): Unit = {
Copy link
Contributor

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...

Copy link
Contributor Author

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.

Copy link
Contributor

@dubinsky dubinsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!!!

@dubinsky dubinsky merged commit ee8ae94 into scala:main Mar 27, 2023
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 <[email protected]>
Signed-off-by: Sean Owen <[email protected]>
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

Successfully merging this pull request may close these issues.

Infinite loop caused by unclosed character ref in MarkupParser#content

2 participants