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 b8e6aa3f2a Fix possible NPE
b8e6aa3f2a is described below
commit b8e6aa3f2aa9c1f24f4fb4696b240a7723d0d48d
Author: remm <[email protected]>
AuthorDate: Mon Sep 11 12:49:31 2023 +0200
Fix possible NPE
Found by coverity.
---
java/org/apache/catalina/realm/RealmBase.java | 3 +++
1 file changed, 3 insertions(+)
diff --git a/java/org/apache/catalina/realm/RealmBase.java
b/java/org/apache/catalina/realm/RealmBase.java
index 03ea46f4dd..d29ea1a0eb 100644
--- a/java/org/apache/catalina/realm/RealmBase.java
+++ b/java/org/apache/catalina/realm/RealmBase.java
@@ -847,6 +847,9 @@ public abstract class RealmBase extends LifecycleMBeanBase
implements Realm {
// For AllRolesMode.STRICT_AUTH_ONLY_MODE there must be
zero roles
roles = request.getContext().findSecurityRoles();
+ if (roles == null) {
+ roles = new String[0];
+ }
if (roles.length == 0 && allRolesMode ==
AllRolesMode.STRICT_AUTH_ONLY_MODE) {
if (log.isDebugEnabled()) {
log.debug("Granting access for role-name=*, strict
auth-only");
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]