From: Howard Chu Date: Mon, 19 Sep 2011 01:13:23 +0000 (-0700) Subject: Make sure 2 subpages fit in one real page X-Git-Tag: OPENLDAP_REL_ENG_2_4_27~148^2~22 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=4272e7de4f2f068b99cc6e32dd4ba86beb4d7266;p=openldap Make sure 2 subpages fit in one real page --- diff --git a/libraries/libmdb/mdb.c b/libraries/libmdb/mdb.c index 6f279e3cb8..117a891339 100644 --- a/libraries/libmdb/mdb.c +++ b/libraries/libmdb/mdb.c @@ -3695,7 +3695,8 @@ top: offset = NODESIZE + sizeof(indx_t) + data->mv_size; } offset += offset & 1; - if (NODEDSZ(leaf) + offset >= mc->mc_txn->mt_env->me_psize / MDB_MINKEYS) { + if (NODESIZE + NODEKSZ(leaf) + NODEDSZ(leaf) + offset >= + (mc->mc_txn->mt_env->me_psize - PAGEHDRSZ) / MDB_MINKEYS) { /* yes, convert it */ dummy.md_flags = 0; if (mc->mc_db->md_flags & MDB_DUPFIXED) {