From cd7227b4c60512efd4c155b303593347bcfd0880 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Fri, 23 May 2008 15:40:15 +0000 Subject: [PATCH] ITS#5511 make room for filter's terminating NUL character --- servers/slapd/overlays/unique.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/servers/slapd/overlays/unique.c b/servers/slapd/overlays/unique.c index 037ceeccde..ada451dc63 100644 --- a/servers/slapd/overlays/unique.c +++ b/servers/slapd/overlays/unique.c @@ -1058,6 +1058,9 @@ unique_add( /* skip this domain-uri if it isn't involved */ if ( !ks ) continue; + /* terminating NUL */ + ks++; + if ( uri->filter.bv_val && uri->filter.bv_len ) ks += uri->filter.bv_len + STRLENOF ("(&)"); kp = key = op->o_tmpalloc(ks, op->o_tmpmemctx); @@ -1166,6 +1169,9 @@ unique_modify( /* skip this domain-uri if it isn't involved */ if ( !ks ) continue; + /* terminating NUL */ + ks++; + if ( uri->filter.bv_val && uri->filter.bv_len ) ks += uri->filter.bv_len + STRLENOF ("(&)"); kp = key = op->o_tmpalloc(ks, op->o_tmpmemctx); @@ -1299,6 +1305,9 @@ unique_modrdn( /* skip this domain if it isn't involved */ if ( !ks ) continue; + /* terminating NUL */ + ks++; + if ( uri->filter.bv_val && uri->filter.bv_len ) ks += uri->filter.bv_len + STRLENOF ("(&)"); kp = key = op->o_tmpalloc(ks, op->o_tmpmemctx); -- 2.39.5