mdbx: fix mdbx_node_add_leaf2().

Change-Id: I07c5f7c1e3e21cbc4699a4fee69d651ac0779aca
This commit is contained in:
Leonid Yuriev 2018-09-07 00:40:28 +03:00 committed by Leo Yuriev
parent 6206b67d32
commit 78143d9a48

View File

@ -8696,9 +8696,8 @@ static int __must_check_result mdbx_node_add_leaf2(MDBX_cursor *mc,
mdbx_cassert(mc, ksize == key->iov_len);
const int room = SIZELEFT(mp);
const int entry_size = ksize + sizeof(indx_t);
mdbx_cassert(mc, room >= entry_size);
if (unlikely(room < entry_size)) {
mdbx_cassert(mc, room >= (int)ksize);
if (unlikely(room < (int)ksize)) {
bailout:
mc->mc_txn->mt_flags |= MDBX_TXN_ERROR;
return MDBX_PAGE_FULL;