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

remm pushed a commit to branch 11.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/11.0.x by this push:
     new 8e5e0949a8 Evaluate to false for any invalid paths to avoid NPE
8e5e0949a8 is described below

commit 8e5e0949a838d1b2e14f46068ce3abb3007b05b9
Author: remm <r...@apache.org>
AuthorDate: Fri Jul 4 16:27:55 2025 +0200

    Evaluate to false for any invalid paths to avoid NPE
    
    Found by coverity.
---
 java/org/apache/catalina/servlets/WebdavServlet.java | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/java/org/apache/catalina/servlets/WebdavServlet.java 
b/java/org/apache/catalina/servlets/WebdavServlet.java
index b83ecdbd9e..4057e3e062 100644
--- a/java/org/apache/catalina/servlets/WebdavServlet.java
+++ b/java/org/apache/catalina/servlets/WebdavServlet.java
@@ -680,6 +680,10 @@ public class WebdavServlet extends DefaultServlet 
implements PeriodicEventListen
                 if (hrefs.hasNext()) {
                     currentHref = hrefs.next();
                     currentPath = getPathFromHref(currentHref, request);
+                    if (currentPath == null) {
+                        // The path was invalid
+                        return false;
+                    }
                     currentWebResource = resources.getResource(currentPath);
                 } else {
                     break;


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

Reply via email to