Author: markt Date: Fri Apr 6 20:57:21 2018 New Revision: 1828565 URL: http://svn.apache.org/viewvc?rev=1828565&view=rev Log: Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=62263 Avoid a NullPointerException when the RemoteIpValve processes a request for which no Context can be found.
Modified: tomcat/trunk/java/org/apache/catalina/connector/Request.java tomcat/trunk/webapps/docs/changelog.xml Modified: tomcat/trunk/java/org/apache/catalina/connector/Request.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/Request.java?rev=1828565&r1=1828564&r2=1828565&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/connector/Request.java (original) +++ tomcat/trunk/java/org/apache/catalina/connector/Request.java Fri Apr 6 20:57:21 2018 @@ -1522,6 +1522,9 @@ public class Request implements HttpServ private void notifyAttributeAssigned(String name, Object value, Object oldValue) { Context context = getContext(); + if (context == null) { + return; + } Object listeners[] = context.getApplicationEventListeners(); if ((listeners == null) || (listeners.length == 0)) { return; Modified: tomcat/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1828565&r1=1828564&r2=1828565&view=diff ============================================================================== --- tomcat/trunk/webapps/docs/changelog.xml (original) +++ tomcat/trunk/webapps/docs/changelog.xml Fri Apr 6 20:57:21 2018 @@ -45,6 +45,15 @@ issues do not "pop up" wrt. others). --> <section name="Tomcat 9.0.8 (markt)" rtext="in development"> + <subsection name="Catalina"> + <changelog> + <fix> + <bug>62263</bug>: Avoid a <code>NullPointerException</code> when the + <code>RemoteIpValve</code> processes a request for which no Context can + be found. (markt) + </fix> + </changelog> + </subsection> <subsection name="Coyote"> <changelog> <fix> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org