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 b67bed283c Fix possible NPE
b67bed283c is described below

commit b67bed283c6597e23c4b34a08c4070629fc8200e
Author: remm <r...@apache.org>
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 98cd3885bc..da240b2ba8 100644
--- a/java/org/apache/catalina/realm/JNDIRealm.java
+++ b/java/org/apache/catalina/realm/JNDIRealm.java
@@ -1257,7 +1257,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);
                             }
@@ -1287,7 +1287,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: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to