This is an automated email from the ASF dual-hosted git repository.
remm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push:
new 4a361631bc Avoid possible NPE
4a361631bc is described below
commit 4a361631bc00968733724d7f1b125ebc2741a54e
Author: remm <[email protected]>
AuthorDate: Tue Aug 20 14:15:59 2024 +0200
Avoid possible NPE
Found by coverity.
---
java/org/apache/catalina/filters/CsrfPreventionFilter.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/java/org/apache/catalina/filters/CsrfPreventionFilter.java
b/java/org/apache/catalina/filters/CsrfPreventionFilter.java
index 93f53f18a3..404fa0ff73 100644
--- a/java/org/apache/catalina/filters/CsrfPreventionFilter.java
+++ b/java/org/apache/catalina/filters/CsrfPreventionFilter.java
@@ -241,7 +241,9 @@ public class CsrfPreventionFilter extends
CsrfPreventionFilterBase {
@Override
public boolean test(String t) {
String mimeType = context.getMimeType(t);
-
+ if (mimeType == null) {
+ return false;
+ }
return predicate.test(mimeType);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]