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 0dd5fcc305 Avoid possible NPE
0dd5fcc305 is described below
commit 0dd5fcc305017f1cb12968fd87f4d7b497e8d60f
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]