You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2019/12/17 21:53:38 UTC

[tomcat] branch 8.5.x updated: Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=64005 avoid NPE

This is an automated email from the ASF dual-hosted git repository.

markt 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 60ee3d6  Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=64005 avoid NPE
60ee3d6 is described below

commit 60ee3d6e923aa60d622be550858ce4ceb136de24
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Tue Dec 17 21:51:08 2019 +0000

    Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=64005 avoid NPE
    
    Avoid the NPE when working with the URL for the root of a packed WAR
---
 java/org/apache/catalina/webresources/CachedResource.java | 10 ++++++++++
 webapps/docs/changelog.xml                                |  5 +++++
 2 files changed, 15 insertions(+)

diff --git a/java/org/apache/catalina/webresources/CachedResource.java b/java/org/apache/catalina/webresources/CachedResource.java
index 58247a8..712a463 100644
--- a/java/org/apache/catalina/webresources/CachedResource.java
+++ b/java/org/apache/catalina/webresources/CachedResource.java
@@ -26,6 +26,7 @@ import java.net.URLConnection;
 import java.net.URLStreamHandler;
 import java.security.Permission;
 import java.security.cert.Certificate;
+import java.util.jar.JarEntry;
 import java.util.jar.JarFile;
 import java.util.jar.Manifest;
 
@@ -557,5 +558,14 @@ public class CachedResource implements WebResource {
         public JarFile getJarFile() throws IOException {
             return ((JarURLConnection) resourceURL.openConnection()).getJarFile();
         }
+
+        @Override
+        public JarEntry getJarEntry() throws IOException {
+            if (getEntryName() == null) {
+                return null;
+            } else {
+                return super.getJarEntry();
+            }
+        }
     }
 }
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index ca53ee8..b9e116e 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -69,6 +69,11 @@
         config. (isapir/markt)
       </add>
       <fix>
+        <bug>64005</bug>: Correct a regression in the static resource caching
+        changes introduced in 8.5.28. Avoid a <code>NullPointerException</code>
+        when working with the URL provided for the root of a packed WAR. (markt)
+      </fix>
+      <fix>
         <bug>64008</bug>: Clarify/expand the Javadoc for the
         <code>Tomcat#addWebapp()</code> and related methods. (markt)
       </fix>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org