]> git.sur5r.net Git - openldap/commitdiff
ITS#6270, refix patch from ITS#5511
authorHoward Chu <hyc@openldap.org>
Mon, 30 Nov 2009 06:07:22 +0000 (06:07 +0000)
committerHoward Chu <hyc@openldap.org>
Mon, 30 Nov 2009 06:07:22 +0000 (06:07 +0000)
servers/slapd/overlays/unique.c

index 62d27430c8e5eaebfbb916cf02d1084b76918391..42d6cf24c9c547636616edfdcf3bf024d6641081 100644 (file)
@@ -1074,13 +1074,13 @@ unique_add(
              domain = domain->next )
        {
                unique_domain_uri *uri;
-               int ks = STRLENOF("(|)");
 
                for ( uri = domain->uri;
                      uri;
                      uri = uri->next )
                {
                        int len;
+                       int ks = 0;
 
                        if ( uri->ndn.bv_val
                             && !dnIsSuffix( &op->o_req_ndn, &uri->ndn ))
@@ -1117,7 +1117,7 @@ unique_add(
                        if ( !ks ) continue;
 
                        /* terminating NUL */
-                       ks++;
+                       ks += sizeof("(|)");
 
                        if ( uri->filter.bv_val && uri->filter.bv_len )
                                ks += uri->filter.bv_len + STRLENOF ("(&)");
@@ -1195,13 +1195,13 @@ unique_modify(
              domain = domain->next )
        {
                unique_domain_uri *uri;
-               int ks = STRLENOF("(|)");
 
                for ( uri = domain->uri;
                      uri;
                      uri = uri->next )
                {
                        int len;
+                       int ks = 0;
 
                        if ( uri->ndn.bv_val
                             && !dnIsSuffix( &op->o_req_ndn, &uri->ndn ))
@@ -1228,7 +1228,7 @@ unique_modify(
                        if ( !ks ) continue;
 
                        /* terminating NUL */
-                       ks++;
+                       ks += sizeof("(|)");
 
                        if ( uri->filter.bv_val && uri->filter.bv_len )
                                ks += uri->filter.bv_len + STRLENOF ("(&)");
@@ -1309,13 +1309,13 @@ unique_modrdn(
              domain = domain->next )
        {
                unique_domain_uri *uri;
-               int ks = STRLENOF("(|)");
 
                for ( uri = domain->uri;
                      uri;
                      uri = uri->next )
                {
                        int i, len;
+                       int ks = 0;
 
                        if ( uri->ndn.bv_val
                             && !dnIsSuffix( &op->o_req_ndn, &uri->ndn )
@@ -1364,7 +1364,7 @@ unique_modrdn(
                        if ( !ks ) continue;
 
                        /* terminating NUL */
-                       ks++;
+                       ks += sizeof("(|)");
 
                        if ( uri->filter.bv_val && uri->filter.bv_len )
                                ks += uri->filter.bv_len + STRLENOF ("(&)");