Laplandia / owaspantisamy

Automatically exported from code.google.com/p/owaspantisamy
0 stars 0 forks source link

NullPointerException occurs when scanning document with empty table->tr->td element #147

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Scan the following html: "<table><tr><td></td></tr></table>" using the 
tinymce policy file.

What is the expected output? What do you see instead?
I would expect AntiSamy to remove the table. Instead a NullPointerException 
occurs:
java.lang.NullPointerException
    at org.owasp.validator.html.scan.AntiSamyDOMScanner.removeNode(AntiSamyDOMScanner.java:776)
    at org.owasp.validator.html.scan.AntiSamyDOMScanner.promoteChildren(AntiSamyDOMScanner.java:870)
    at org.owasp.validator.html.scan.AntiSamyDOMScanner.recursiveValidateTag(AntiSamyDOMScanner.java:374)
    at org.owasp.validator.html.scan.AntiSamyDOMScanner.recursiveValidateTag(AntiSamyDOMScanner.java:355)
    at org.owasp.validator.html.scan.AntiSamyDOMScanner.recursiveValidateTag(AntiSamyDOMScanner.java:355)
    at org.owasp.validator.html.scan.AntiSamyDOMScanner.recursiveValidateTag(AntiSamyDOMScanner.java:355)
    at org.owasp.validator.html.scan.AntiSamyDOMScanner.recursiveValidateTag(AntiSamyDOMScanner.java:355)
    at org.owasp.validator.html.scan.AntiSamyDOMScanner.scan(AntiSamyDOMScanner.java:155)
    at org.owasp.validator.html.AntiSamy.scan(AntiSamy.java:107)
    at ...

What version of the product are you using? On what operating system?
Version 1.4.5 on Windows 7.

Please provide any additional information below.
It works if I insert a space in the td element: <table><tr><td> 
</td></tr></table>

Original issue reported on code.google.com by hen...@oddershede.org on 22 Jan 2013 at 2:26

GoogleCodeExporter commented 9 years ago
Fixed in 1832424f27bb2217305f769750e4dd815d25a7f2, thanks for the testcase

Original comment by kristian...@gmail.com on 28 Jan 2013 at 7:10