From: Howard Chu Date: Wed, 16 Oct 2024 16:36:18 +0000 (+0100) Subject: ITS#9920 lmdb: fix page offset when converting subpage to real page X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e7891c016a4518eaf0aa29f959b0cc8a22d4111;p=thirdparty%2Fopenldap.git ITS#9920 lmdb: fix page offset when converting subpage to real page offset needs to account for additional space at page tail --- diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index 8863b6df5a..0dea5c63f4 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -8593,7 +8593,7 @@ prep_subDB: if ((rc = mdb_page_alloc(mc, 1, &mp))) return rc; fp_flags |= mp->mp_flags; /* P_ADM_FLAGS */ - offset = env->me_psize - olddata.mv_size; + offset = env->me_pagespace + PAGEHDRSZ - olddata.mv_size; flags |= F_DUPDATA|F_SUBDATA; dummy.md_root = mp->mp_pgno; sub_root = mp;