]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#9551 Handle empty DN in extended filters
authorOndřej Kuzník <ondra@mistotebe.net>
Tue, 11 May 2021 12:20:52 +0000 (13:20 +0100)
committerQuanah Gibson-Mount <quanah@openldap.org>
Thu, 13 May 2021 18:33:25 +0000 (18:33 +0000)
servers/slapd/dn.c

index 15b5d15b90d6015a456142b8a444e77f56947f31..f8db824c20ec79edfa2d463a582d0f92607c119a 100644 (file)
@@ -839,7 +839,9 @@ dnRelativeMatch(
                        match = memcmp( value->bv_val, asserted->bv_val, 
                                value->bv_len );
                } else {
-                       if( DN_SEPARATOR(
+                       if ( BER_BVISEMPTY( asserted ) ) {
+                               match = 0;
+                       } else if ( DN_SEPARATOR(
                                value->bv_val[value->bv_len - asserted->bv_len - 1] ))
                        {
                                match = memcmp(
@@ -865,7 +867,9 @@ dnRelativeMatch(
                if( asserted->bv_len >= value->bv_len ) {
                        match = -1;
                } else {
-                       if( DN_SEPARATOR(
+                       if ( BER_BVISEMPTY( asserted ) ) {
+                               match = 0;
+                       } else if ( DN_SEPARATOR(
                                value->bv_val[value->bv_len - asserted->bv_len - 1] ))
                        {
                                match = memcmp(