Ignore current cursor pos if it's out of bounds.
vmware
Howard Chu 13 years ago
parent d1a7fa267b
commit 23219ed32a
  1. 2
      libraries/libmdb/mdb.c

@ -3858,6 +3858,7 @@ mdb_cursor_set(MDB_cursor *mc, MDB_val *key, MDB_val *data,
goto set1; goto set1;
} }
if (rc < 0) { if (rc < 0) {
if (mc->mc_ki[mc->mc_top] < NUMKEYS(mp)) {
/* This is definitely the right page, skip search_page */ /* This is definitely the right page, skip search_page */
if (mp->mp_flags & P_LEAF2) { if (mp->mp_flags & P_LEAF2) {
nodekey.mv_data = LEAF2KEY(mp, nodekey.mv_data = LEAF2KEY(mp,
@ -3873,6 +3874,7 @@ mdb_cursor_set(MDB_cursor *mc, MDB_val *key, MDB_val *data,
*exactp = 1; *exactp = 1;
goto set1; goto set1;
} }
}
rc = 0; rc = 0;
goto set2; goto set2;
} }

Loading…
Cancel
Save