Commit b6019af7 authored by Howard Chu's avatar Howard Chu
Browse files

Fix off-by-one in octetStringSubstringsFilter

parent ae6b117a
......@@ -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;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment