This is an automated email from the ASF dual-hosted git repository. remm pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/8.5.x by this push: new d49329c 64149: Avoid NPE when using the access log valve without a pattern d49329c is described below commit d49329c8d419974a7013ba22c8abe93c15c66ce1 Author: remm <r...@apache.org> AuthorDate: Tue Mar 24 16:47:35 2020 +0100 64149: Avoid NPE when using the access log valve without a pattern There was already a check for that on logElements in the log method, which is also null in that case. So cachedElements needs the same null check. --- java/org/apache/catalina/valves/AbstractAccessLogValve.java | 4 +++- webapps/docs/changelog.xml | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/java/org/apache/catalina/valves/AbstractAccessLogValve.java b/java/org/apache/catalina/valves/AbstractAccessLogValve.java index a55b289..51a771f 100644 --- a/java/org/apache/catalina/valves/AbstractAccessLogValve.java +++ b/java/org/apache/catalina/valves/AbstractAccessLogValve.java @@ -682,8 +682,10 @@ public abstract class AbstractAccessLogValve extends ValveBase implements Access // to be cached in the request. request.getAttribute(Globals.CERTIFICATES_ATTR); } - for (CachedElement element : cachedElements) { + if (cachedElements != null) { + for (CachedElement element : cachedElements) { element.cache(request); + } } getNext().invoke(request, response); } diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 7f7b48e..90e9050 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -62,6 +62,10 @@ format is reused. Test case submitted by Gary Thomas. (remm) </fix> <fix> + <bug>64149</bug>: Avoid NPE when using the access log valve without + a pattern. (remm) + </fix> + <fix> <bug>64247</bug>: Using a wildcard for <code>jarsToSkip</code> should not override a possibly present <code>jarsToScan</code>. Based on code submitted by Iridias. (remm) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org