mirror of
https://github.com/isar/libmdbx.git
synced 2024-10-30 11:29:19 +08:00
mdbx: check page bound inside mdbx_page_get().
Change-Id: I7649c3c65c19013e1b367e7554fbe823ea0511d2
This commit is contained in:
parent
21858201e0
commit
32c63077a4
@ -6352,9 +6352,13 @@ static int mdbx_page_get(MDBX_cursor *mc, pgno_t pgno, MDBX_page **ret,
|
||||
|
||||
mapped:
|
||||
p = pgno2page(env, pgno);
|
||||
/* TODO: check p->mp_validator here */
|
||||
|
||||
done:
|
||||
if (unlikely(p->mp_upper < p->mp_lower ||
|
||||
PAGEHDRSZ + p->mp_upper > env->me_psize))
|
||||
return MDBX_CORRUPTED;
|
||||
/* TODO: more checks here, including p->mp_validator */
|
||||
|
||||
*ret = p;
|
||||
if (lvl)
|
||||
*lvl = level;
|
||||
|
Loading…
Reference in New Issue
Block a user