Menu

#190 NullPointerException in HtmlCleaner.makeTree

v2.22
closed-fixed
nobody
None
5
2017-06-14
2017-06-14
No

Starting in the 2.19 release, some malformed documents with an xmlns can cause a NullPointerException in HtmlCleaner.makeTree().

Minimal test case:

1 Attachments

Discussion

  • Michael Ryan

    Michael Ryan - 2017-06-14

    Oops, sourceforge ate part of the markup. Here's the minimal test case:

    <html xmlns="x"><ul><a>

    And the stacktrace:
    java.lang.NullPointerException
    at org.htmlcleaner.HtmlCleaner.makeTree(HtmlCleaner.java:1097)
    at org.htmlcleaner.HtmlTokenizer.addToken(HtmlTokenizer.java:103)
    at org.htmlcleaner.HtmlTokenizer.tagStart(HtmlTokenizer.java:546)
    at org.htmlcleaner.HtmlTokenizer.start(HtmlTokenizer.java:480)
    at org.htmlcleaner.HtmlCleaner.clean(HtmlCleaner.java:461)
    at org.htmlcleaner.HtmlCleaner.clean(HtmlCleaner.java:371)

     

    Last edit: Michael Ryan 2017-06-14
  • Scott Wilson

    Scott Wilson - 2017-06-14
    • status: open --> closed-fixed
     
  • Scott Wilson

    Scott Wilson - 2017-06-14

    Thanks Michael - I've added a null guard to fix this. Its in trunk now.

     

Log in to post a comment.

MongoDB Logo MongoDB