pma: _node_get bounds checking

This commit is contained in:
barter-simsum 2024-03-13 15:24:20 -04:00
parent b6cf968083
commit 2577875c3b

View File

@ -382,9 +382,8 @@ struct BT_findpath {
static BT_page * static BT_page *
_node_get(BT_state *state, pgno_t pgno) _node_get(BT_state *state, pgno_t pgno)
{ {
/* TODO: wrap in DEBUG macro a looping assert to confirm the given pgno is
contained within a node partition */
assert(pgno >= BT_NUMMETAS); assert(pgno >= BT_NUMMETAS);
assert(pgno < B2PAGES(BLK_BASE_LEN_TOTAL));
return FO2PA(state->map, pgno); return FO2PA(state->map, pgno);
} }