]> git.sur5r.net Git - openldap/commitdiff
Fix another SEGV from previous patch.
authorHoward Chu <hyc@openldap.org>
Sat, 22 Sep 2001 05:35:52 +0000 (05:35 +0000)
committerHoward Chu <hyc@openldap.org>
Sat, 22 Sep 2001 05:35:52 +0000 (05:35 +0000)
servers/slapd/back-ldbm/idl.c

index a3fa50eb77109cd4a848a33882845125a138b88c..9196018aa7e3312029b2b1485ec27b648af79438 100644 (file)
@@ -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? */