From: Howard Chu Date: Fri, 23 May 2008 15:40:15 +0000 (+0000) Subject: ITS#5511 make room for filter's terminating NUL character X-Git-Tag: LOCKER_IDS~151 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=cd7227b4c60512efd4c155b303593347bcfd0880;p=openldap ITS#5511 make room for filter's terminating NUL character --- 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);