From f827aa683ecd61ce7528c4351789eebf13b07911 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Tue, 19 Feb 2013 18:19:47 -0800 Subject: [PATCH] ITS#7527 add missing error checks for corrupt index --- servers/slapd/back-mdb/idl.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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; -- 2.39.5