Uploaded image for project: 'Commons Text'
  1. Commons Text
  2. TEXT-44

NumericEntityUnescaper.translate throws an IllegalArgumentException if entityValue > MAX_CODE_POINT

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • 1.x
    • None

    Description

      We found that using the function StringEscapeUtils.unescapeHtml4 crashes if the argument is "�" and throws an IllegalArgumentException.

      This happens because internally it calls the function NumericEntityUnescaper.translate and doesn't check if the value is bigger than 0x10FFFF (MAX_CODE_POINT) that is a check inside Character.toChar.

      Maybe we need to check that the entity value is less than Char.MAX_CODE_POINT.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mcanes Miquel Canes
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: