mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-01 23:54:12 +08:00
mdbx: add minor assertions info mdbx_env_walk().
Change-Id: Ibeff6a52088fc858d00b6625a2754aceffb1a382
This commit is contained in:
parent
6efe0686c9
commit
64016c86f6
@ -14359,8 +14359,10 @@ static int __cold mdbx_env_walk(mdbx_walk_ctx_t *ctx, const char *dbi,
|
||||
MDBX_node *node = NODEPTR(mp, i);
|
||||
payload_size += NODESIZE + NODEKSZ(node);
|
||||
|
||||
if (type == MDBX_page_branch)
|
||||
if (type == MDBX_page_branch) {
|
||||
assert(i > 0 || NODEKSZ(node) == 0);
|
||||
continue;
|
||||
}
|
||||
|
||||
assert(type == MDBX_page_leaf);
|
||||
switch (node->mn_flags) {
|
||||
@ -14413,7 +14415,7 @@ static int __cold mdbx_env_walk(mdbx_walk_ctx_t *ctx, const char *dbi,
|
||||
} break;
|
||||
|
||||
case F_DUPDATA /* short sub-page */: {
|
||||
if (unlikely(NODEDSZ(node) < PAGEHDRSZ))
|
||||
if (unlikely(NODEDSZ(node) <= PAGEHDRSZ))
|
||||
return MDBX_CORRUPTED;
|
||||
|
||||
MDBX_page *sp = NODEDATA(node);
|
||||
|
Loading…
x
Reference in New Issue
Block a user