mdbx: assert_fail() when INDXSIZE(key) > nodemax.

Change-Id: I2fadc68a3e682dd3d8b3b8b5f48ed096e9a92288
This commit is contained in:
Leo Yuriev 2017-01-03 16:09:34 +03:00
parent ddb3c32258
commit 5b160be128

5
mdb.c
View File

@ -7232,10 +7232,11 @@ mdb_branch_size(MDB_env *env, MDB_val *key)
size_t sz; size_t sz;
sz = INDXSIZE(key); sz = INDXSIZE(key);
if (sz > env->me_nodemax) { if (unlikely(sz > env->me_nodemax)) {
/* put on overflow page */ /* put on overflow page */
/* not implemented */ /* not implemented */
/* sz -= key->size - sizeof(pgno_t); */ mdb_assert_fail(env, "INDXSIZE(key) <= env->me_nodemax", __FUNCTION__, __LINE__);
sz -= key->mv_size - sizeof(pgno_t);
} }
return sz + sizeof(indx_t); return sz + sizeof(indx_t);