Bug 54382 - Nullpointer Exception after activating SSI and loading of any html-file with a specific comment
Summary: Nullpointer Exception after activating SSI and loading of any html-file with ...
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 7
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 7.0.34
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-07 23:56 UTC by bodure
Modified: 2013-04-27 13:25 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bodure 2013-01-07 23:56:21 UTC
1. Activate SSI on Tomcat and restart Tomcat
2. create an any html-file with a comment like this "<!--#-->" 
3. put this html-file to the webapp folder of tomcat
4. when you now go to the html file via tomcat, you will get an Nullpointer Exception. The SSIServlet.class and other necessary SSI-classes cannot be found
Comment 1 Mark Thomas 2013-01-08 21:45:26 UTC
Thanks for the report. This has been fixed in trunk and 7.0.x and will be included in 7.0.35 onwards.
Comment 2 Konstantin Kolinko 2013-01-08 23:39:52 UTC
Proposed for 6.0.

For the record:
1. The stacktraces in 6.0 are, for SSIServlet and SSIFilter:

java.lang.NullPointerException
	org.apache.catalina.ssi.SSIProcessor.process(SSIProcessor.java:132)
	org.apache.catalina.ssi.SSIServlet.processSSI(SSIServlet.java:208)
	org.apache.catalina.ssi.SSIServlet.requestHandler(SSIServlet.java:174)
	org.apache.catalina.ssi.SSIServlet.doGet(SSIServlet.java:110)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:723)

java.lang.NullPointerException
	org.apache.catalina.ssi.SSIProcessor.process(SSIProcessor.java:132)
	org.apache.catalina.ssi.SSIFilter.doFilter(SSIFilter.java:142)

2. With the patch applied, processing the "<!--#-->" comment replaces it with the following text: 

  "[an error occurred while processing this directive]"

and the following is logged into localhost.*.log file:

  org.apache.catalina.core.ApplicationContext log
  INFO: Unknown command: 

This is OK, because there is very little difference between an empty command name and a wrong command name. If one treats it as a comment and writes any random text after the '#', it would trigger the same error message.
Comment 3 Konstantin Kolinko 2013-04-27 13:25:55 UTC
Fixed in Tomcat 6 by r1476541 , will be in 6.0.37