From: Howard Chu Date: Tue, 1 Feb 2005 13:40:17 +0000 (+0000) Subject: Fix off-by-one in octetStringSubstringsFilter X-Git-Tag: OPENLDAP_REL_ENG_2_3_BP~197 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b6019af7594b40d126d5ea731f6dcd184d6f0f3f;p=openldap Fix off-by-one in octetStringSubstringsFilter --- diff --git a/servers/slapd/schema_init.c b/servers/slapd/schema_init.c index a9df65cf96..5d37337439 100644 --- a/servers/slapd/schema_init.c +++ b/servers/slapd/schema_init.c @@ -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; } }