This is an automated email from the ASF dual-hosted git repository.
remm pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push:
new 6674102ac1 Evaluate to false for any invalid paths to avoid NPE
6674102ac1 is described below
commit 6674102ac1fc1517f7eb3b25ca171f67163694ce
Author: remm <[email protected]>
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 eb48e7b046..393eda3da0 100644
--- a/java/org/apache/catalina/servlets/WebdavServlet.java
+++ b/java/org/apache/catalina/servlets/WebdavServlet.java
@@ -684,6 +684,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: [email protected]
For additional commands, e-mail: [email protected]