mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-26 01:29:59 -05:00
ITS#6715 cleanup: Handle attr_valfind(0 values) when SLAP_ATTR_SORTED_VALS
This commit is contained in:
parent
b68703031b
commit
92986c3434
1 changed files with 3 additions and 3 deletions
|
|
@ -317,11 +317,11 @@ attr_valfind(
|
|||
}
|
||||
|
||||
n = a->a_numvals;
|
||||
if ( a->a_flags & SLAP_ATTR_SORTED_VALS ) {
|
||||
if ( (a->a_flags & SLAP_ATTR_SORTED_VALS) && n ) {
|
||||
/* Binary search */
|
||||
unsigned base = 0;
|
||||
|
||||
while ( 0 < n ) {
|
||||
do {
|
||||
unsigned pivot = n >> 1;
|
||||
i = base + pivot;
|
||||
rc = value_match( &match, a->a_desc, mr, flags,
|
||||
|
|
@ -334,7 +334,7 @@ attr_valfind(
|
|||
} else {
|
||||
n = pivot;
|
||||
}
|
||||
}
|
||||
} while ( n );
|
||||
if ( match < 0 )
|
||||
i++;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue