https://bugs.openldap.org/show_bug.cgi?id=9291
--- Comment #14 from Howard Chu hyc@openldap.org --- (In reply to Markus from comment #13)
(In reply to Howard Chu from comment #12)
You could simply add a check of pgno in mdb_page_get(), and check every page reference as they occur.
How would we know the maximum valid page number (e.g. maxpgno = fsize / env->me_psize)? I assumed we need mdb_fsize, which we obviously don't want to call too often. Happy to learn about a better alternative.
Use mm_last_pg from the meta page.