]> git.sur5r.net Git - openldap/commitdiff
ITS#5511 make room for filter's terminating NUL character
authorHoward Chu <hyc@openldap.org>
Fri, 23 May 2008 15:40:15 +0000 (15:40 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 23 May 2008 15:40:15 +0000 (15:40 +0000)
servers/slapd/overlays/unique.c

index 037ceeccde764c3e769ce1a2a96de991a01e8eaa..ada451dc63cc5a99a9f50b7333d1ced5bf50ca5c 100644 (file)
@@ -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);