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 001e2a9096 Avoid possible NPE
001e2a9096 is described below
commit 001e2a909619e967618cd280d9b39b692d3f75e1
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 cbebf8158e..b7b3a07a94 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]