fix(test): fix issues detected by running unittests in ASAN/UBSAN

This commit is contained in:
bfredl
2023-01-30 14:46:28 +01:00
parent d6d6ab3f8e
commit 42999a8d64
3 changed files with 5 additions and 5 deletions

View File

@@ -1182,7 +1182,7 @@ static size_t check_node(MarkTree *b, mtnode_t *x, mtpos_t *last, bool *last_rig
assert(x->ptr[i] != x->ptr[j]);
}
}
} else {
} else if (x->n > 0) {
*last = x->key[x->n - 1].pos;
}
return n_keys;