From: Howard Chu Date: Wed, 17 Apr 2013 21:33:41 +0000 (-0700) Subject: Fix mdb_rebalance X-Git-Tag: OPENLDAP_REL_ENG_2_4_36~69^2~10 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=dbb9ded2f826a1c05919759492cbffd58e54e243;p=openldap Fix mdb_rebalance Don't do anything with (fake root) subpages --- diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index f25222c9ff..b51f6f9ef3 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -6320,6 +6320,10 @@ mdb_rebalance(MDB_cursor *mc) if (mc->mc_snum < 2) { MDB_page *mp = mc->mc_pg[0]; + if (IS_SUBP(mp)) { + DPUTS("Can't rebalance a subpage, ignoring"); + return MDB_SUCCESS; + } if (NUMKEYS(mp) == 0) { DPUTS("tree is completely empty"); mc->mc_db->md_root = P_INVALID;