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 3fd7af953d Fix possible NPE
3fd7af953d is described below
commit 3fd7af953d7eebc640d6ddbd442add5850530043
Author: remm <[email protected]>
AuthorDate: Mon Sep 11 12:06:51 2023 +0200
Fix possible NPE
Found by coverity.
---
java/org/apache/catalina/realm/JNDIRealm.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/java/org/apache/catalina/realm/JNDIRealm.java
b/java/org/apache/catalina/realm/JNDIRealm.java
index 04fceead64..a37ffc6811 100644
--- a/java/org/apache/catalina/realm/JNDIRealm.java
+++ b/java/org/apache/catalina/realm/JNDIRealm.java
@@ -1264,7 +1264,7 @@ public class JNDIRealm extends RealmBase {
// Search for additional roles
List<String> roles = getRoles(connection,
user);
if (containerLog.isDebugEnabled()) {
- containerLog.debug("Found roles: " +
roles.toString());
+ containerLog.debug("Found roles: " +
((roles == null) ? "" : roles.toString()));
}
return new GenericPrincipal(username,
credentials, roles);
}
@@ -1294,7 +1294,7 @@ public class JNDIRealm extends RealmBase {
// Search for additional roles
List<String> roles = getRoles(connection, user);
if (containerLog.isDebugEnabled()) {
- containerLog.debug("Found roles: " + roles.toString());
+ containerLog.debug("Found roles: " + ((roles == null) ? ""
: roles.toString()));
}
// Create and return a suitable Principal for this user
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]