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

commit 39f970174f9a3e8b77fcfd45d404f4684e0285df
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 aa94cb07ea..016e25b75e 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, 
credentials, 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: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to