From: Hallvard Furuseth Date: Thu, 3 Oct 2013 21:59:25 +0000 (+0200) Subject: mdb_cursor_sibling(): Fix error result X-Git-Tag: OPENLDAP_REL_ENG_2_4_37~27^2~5 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=99ea7669a35a79878394b29cd3448b58daf031fb;p=openldap mdb_cursor_sibling(): Fix error result --- diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index f3e3180e00..e7564be8a0 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -4942,8 +4942,11 @@ mdb_cursor_sibling(MDB_cursor *mc, int move_right) assert(IS_BRANCH(mc->mc_pg[mc->mc_top])); indx = NODEPTR(mc->mc_pg[mc->mc_top], mc->mc_ki[mc->mc_top]); - if ((rc = mdb_page_get(mc->mc_txn, NODEPGNO(indx), &mp, NULL) != 0)) + if ((rc = mdb_page_get(mc->mc_txn, NODEPGNO(indx), &mp, NULL)) != 0) { + /* mc will be inconsistent if caller does mc_snum++ as above */ + mc->mc_flags &= ~(C_INITIALIZED|C_EOF); return rc; + } mdb_cursor_push(mc, mp); if (!move_right)