From: Howard Chu Date: Sat, 22 Sep 2001 05:35:52 +0000 (+0000) Subject: Fix another SEGV from previous patch. X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~1071 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=58f4ffca5948823f65a9324384cbdcd56bd6df3b;p=openldap Fix another SEGV from previous patch. --- diff --git a/servers/slapd/back-ldbm/idl.c b/servers/slapd/back-ldbm/idl.c index a3fa50eb77..9196018aa7 100644 --- a/servers/slapd/back-ldbm/idl.c +++ b/servers/slapd/back-ldbm/idl.c @@ -306,7 +306,7 @@ idl_find( ID id ) { - int lo=0, hi=ID_BLOCK_NIDS(b)-1, nr; + int lo=0, hi=ID_BLOCK_NIDS(b)-1, nr=0; for (;lo<=hi;) { @@ -802,7 +802,7 @@ idl_insert( ID_BLOCK **idl, ID id, unsigned int maxids ) if ( ID_BLOCK_ID(*idl, i) == id ) { return( 2 ); /* already there */ } - if ( ID_BLOCK_ID(*idl, i) < id ) + if ( ID_BLOCK_NIDS(*idl) && ID_BLOCK_ID(*idl, i) < id ) i++; /* do we need to make room for it? */