Author: markt Date: Tue Jan 8 21:41:44 2013 New Revision: 1430550 URL: http://svn.apache.org/viewvc?rev=1430550&view=rev Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=54382 Avoid NPE with an empty SSI directive
Modified: tomcat/trunk/java/org/apache/catalina/ssi/SSIProcessor.java Modified: tomcat/trunk/java/org/apache/catalina/ssi/SSIProcessor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ssi/SSIProcessor.java?rev=1430550&r1=1430549&r2=1430550&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/ssi/SSIProcessor.java (original) +++ tomcat/trunk/java/org/apache/catalina/ssi/SSIProcessor.java Tue Jan 8 21:41:44 2013 @@ -307,11 +307,11 @@ public class SSIProcessor { break; } } - String command = null; - if (firstLetter != -1) { - command = cmd.substring(firstLetter, lastLetter + 1); + if (firstLetter == -1) { + return ""; + } else { + return cmd.substring(firstLetter, lastLetter + 1); } - return command; } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org