ITS#7527 add missing error checks for corrupt index

This commit is contained in:
Howard Chu 2013-02-19 18:19:47 -08:00
parent c6a4982793
commit f827aa683e

View File

@ -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;