From: Howard Chu Date: Wed, 20 Feb 2013 02:19:47 +0000 (-0800) Subject: ITS#7527 add missing error checks for corrupt index X-Git-Tag: OPENLDAP_REL_ENG_2_5_0ALPHA~704 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f827aa683ecd61ce7528c4351789eebf13b07911;p=thirdparty%2Fopenldap.git ITS#7527 add missing error checks for corrupt index --- diff --git a/servers/slapd/back-mdb/idl.c b/servers/slapd/back-mdb/idl.c index 2cba7c2759..eee2afc670 100644 --- a/servers/slapd/back-mdb/idl.c +++ b/servers/slapd/back-mdb/idl.c @@ -505,9 +505,17 @@ mdb_idl_insert_keys( if ( id < lo || id > hi ) { /* position on lo */ rc = mdb_cursor_get( cursor, &key, &data, MDB_NEXT_DUP ); + if ( rc != 0 ) { + err = "c_get lo"; + goto fail; + } if ( id > hi ) { /* position on hi */ rc = mdb_cursor_get( cursor, &key, &data, MDB_NEXT_DUP ); + if ( rc != 0 ) { + err = "c_get hi"; + goto fail; + } } data.mv_size = sizeof(ID); data.mv_data = &id;