From 4a12975f61c158657cefd9886899074258e2dc84 Mon Sep 17 00:00:00 2001 From: leitner Date: Sat, 13 Jun 2015 12:05:16 +0000 Subject: [PATCH] off by one --- tinyldap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tinyldap.c b/tinyldap.c index 8c5abdb..2cf86d4 100644 --- a/tinyldap.c +++ b/tinyldap.c @@ -601,12 +601,14 @@ static void tagmatches(uint32* index,size_t elements,struct string* s, struct bitfield* b,int (*match)(struct string* s,const char* c), uint32 index_type,enum FilterType ft) { uint32 bottom=0; - uint32 top=elements; + uint32 top=elements-1; uint32 mid,k,m; long rec; rec=0; emptyset(b); + if (!elements) return; + while ((top>=bottom)) { int l;