From b0b0fc8c67fe484c0036c06a690580a4ba919bb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Kuzn=C3=ADk?= Date: Tue, 11 May 2021 13:20:52 +0100 Subject: [PATCH] ITS#9551 Handle empty DN in extended filters --- servers/slapd/dn.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/servers/slapd/dn.c b/servers/slapd/dn.c index 15b5d15b90..f8db824c20 100644 --- a/servers/slapd/dn.c +++ b/servers/slapd/dn.c @@ -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(