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 dcdf981ca9 Avoid possible NPE
dcdf981ca9 is described below
commit dcdf981ca953392464ab481f7452598cc3744b73
Author: remm <[email protected]>
AuthorDate: Thu Sep 14 11:27:51 2023 +0200
Avoid possible NPE
Found by coverity.
---
java/org/apache/catalina/webresources/AbstractFileResourceSet.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/java/org/apache/catalina/webresources/AbstractFileResourceSet.java
b/java/org/apache/catalina/webresources/AbstractFileResourceSet.java
index 6d7961c956..7a81b943b0 100644
--- a/java/org/apache/catalina/webresources/AbstractFileResourceSet.java
+++ b/java/org/apache/catalina/webresources/AbstractFileResourceSet.java
@@ -107,7 +107,7 @@ public abstract class AbstractFileResourceSet extends
AbstractResourceSet {
// absoluteBase has been normalized so absPath needs to be normalized
as
// well.
String absPath = normalize(file.getAbsolutePath());
- if (absoluteBase.length() > absPath.length()) {
+ if (absPath == null || absoluteBase.length() > absPath.length()) {
return null;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]