mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-04 17:54:13 +08:00
mdbx: minor fix EINVAL
from mdbx_env_set_geometry()
.
Silently growth `size_lower` to the `MIN_PAGENO` instead of returning `MDBX_EINVAL`.
This commit is contained in:
parent
6e2a1ebfbd
commit
c499f2bb36
@ -11796,8 +11796,13 @@ mdbx_env_set_geometry(MDBX_env *env, intptr_t size_lower, intptr_t size_now,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((uint64_t)size_lower / pagesize < MIN_PAGENO) {
|
if ((uint64_t)size_lower / pagesize < MIN_PAGENO) {
|
||||||
rc = MDBX_EINVAL;
|
size_lower = pagesize * MIN_PAGENO;
|
||||||
goto bailout;
|
if (unlikely(size_lower > size_upper)) {
|
||||||
|
rc = MDBX_EINVAL;
|
||||||
|
goto bailout;
|
||||||
|
}
|
||||||
|
if (size_now < size_lower)
|
||||||
|
size_now = size_lower;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (unlikely((size_t)size_upper > MAX_MAPSIZE ||
|
if (unlikely((size_t)size_upper > MAX_MAPSIZE ||
|
||||||
|
Loading…
x
Reference in New Issue
Block a user