This is an automated email from the ASF dual-hosted git repository.

markt-asf 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 d6219a8e98 More follow-up to o.a.c.realm code review
d6219a8e98 is described below

commit d6219a8e98649b1c2e3f4bbde42b981c156e5a25
Author: Mark Thomas <[email protected]>
AuthorDate: Tue Jun 16 15:45:44 2026 +0100

    More follow-up to o.a.c.realm code review
    
    Looking at this again, returning null values makes no sense in the
    context Tomcat uses the list of values
---
 java/org/apache/catalina/realm/JNDIRealm.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/realm/JNDIRealm.java 
b/java/org/apache/catalina/realm/JNDIRealm.java
index 824db3f127..f06f1523b0 100644
--- a/java/org/apache/catalina/realm/JNDIRealm.java
+++ b/java/org/apache/catalina/realm/JNDIRealm.java
@@ -2327,7 +2327,8 @@ public class JNDIRealm extends RealmBase {
                 Object value = e.next();
                 String valueString;
                 if (value == null) {
-                    valueString = null;
+                    // Where this is used (roles) it makes to sense to pass on 
null values
+                    continue;
                 } else if (value instanceof byte[]) {
                     valueString = new String((byte[]) value, 
StandardCharsets.UTF_8);
                 } else {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to