This is an automated email from the ASF dual-hosted git repository.
remm pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push:
new 7c900aad3d Fix possible NPE
7c900aad3d is described below
commit 7c900aad3da3dd628ca3da809d88cba20ddd5066
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 7232262346..3054a81229 100644
--- a/java/org/apache/catalina/realm/JNDIRealm.java
+++ b/java/org/apache/catalina/realm/JNDIRealm.java
@@ -1255,7 +1255,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, roles);
}
@@ -1285,7 +1285,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]