]> git.sur5r.net Git - openldap/commitdiff
Fix off-by-one in octetStringSubstringsFilter
authorHoward Chu <hyc@openldap.org>
Tue, 1 Feb 2005 13:40:17 +0000 (13:40 +0000)
committerHoward Chu <hyc@openldap.org>
Tue, 1 Feb 2005 13:40:17 +0000 (13:40 +0000)
servers/slapd/schema_init.c

index a9df65cf9612e29045e32396b5acf082d7f44d9e..5d373374397479658ec9cd727cac7c939bc66ae4 100644 (file)
@@ -537,7 +537,7 @@ octetStringSubstringsFilter (
                if ( sa->sa_initial.bv_len > index_substr_if_maxlen &&
                        ( flags & SLAP_INDEX_SUBSTR_ANY ))
                {
-                       nkeys += (sa->sa_initial.bv_len - index_substr_if_maxlen) / index_substr_any_step;
+                       nkeys += 1 + (sa->sa_initial.bv_len - index_substr_if_maxlen) / index_substr_any_step;
                }
        }
 
@@ -560,7 +560,7 @@ octetStringSubstringsFilter (
                if ( sa->sa_final.bv_len > index_substr_if_maxlen &&
                        ( flags & SLAP_INDEX_SUBSTR_ANY ))
                {
-                       nkeys += (sa->sa_final.bv_len - index_substr_if_maxlen) / index_substr_any_step;
+                       nkeys += 1 + (sa->sa_final.bv_len - index_substr_if_maxlen) / index_substr_any_step;
                }
        }