diff --git a/src/mdbx.c b/src/mdbx.c index 96a236dd..80091c44 100644 --- a/src/mdbx.c +++ b/src/mdbx.c @@ -2375,7 +2375,7 @@ static int mdbx_page_alloc(MDBX_cursor *mc, unsigned num, MDBX_page **mp, /* Append PNL from FreeDB record to me_reclaimed_pglist */ mdbx_cassert(mc, (mc->mc_flags & C_GCFREEZE) == 0); pgno_t *re_pnl = (pgno_t *)data.iov_base; - mdbx_tassert(txn, data.iov_len == MDBX_PNL_SIZEOF(re_pnl)); + mdbx_tassert(txn, data.iov_len >= MDBX_PNL_SIZEOF(re_pnl)); mdbx_tassert(txn, mdbx_pnl_check(re_pnl, false)); repg_pos = MDBX_PNL_SIZE(re_pnl); if (!repg_list) { diff --git a/src/tools/mdbx_chk.c b/src/tools/mdbx_chk.c index e11305f8..e3ffe3ac 100644 --- a/src/tools/mdbx_chk.c +++ b/src/tools/mdbx_chk.c @@ -420,7 +420,8 @@ static int handle_freedb(const uint64_t record_number, const MDBX_val *key, "%" PRIuSIZE " > %" PRIuSIZE " (corruption)", (number + 1) * sizeof(pgno_t), data->iov_len); number = data->iov_len / sizeof(pgno_t) - 1; - } else if ((number + 1) * sizeof(pgno_t) < data->iov_len) + } else if (data->iov_len - (number + 1) * sizeof(pgno_t) > + sizeof(pgno_t) * 2) problem_add("entry", record_number, "extra idl space", "%" PRIuSIZE " < %" PRIuSIZE " (minor, not a trouble)", (number + 1) * sizeof(pgno_t), data->iov_len);