From 8ef8733ddcbb927fb95b94f8488ccbb103f509ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9B=D0=B5=D0=BE=D0=BD=D0=B8=D0=B4=20=D0=AE=D1=80=D1=8C?= =?UTF-8?q?=D0=B5=D0=B2=20=28Leonid=20Yuriev=29?= Date: Sat, 4 Dec 2021 01:08:55 +0300 Subject: [PATCH] mdbx: minor refine `mdbx_env_set_option(MDBX_opt_sync_bytes)`. --- src/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core.c b/src/core.c index 2e06edfd..ce64cfdc 100644 --- a/src/core.c +++ b/src/core.c @@ -21900,7 +21900,7 @@ __cold int mdbx_env_set_option(MDBX_env *env, const MDBX_option_t option, return MDBX_EACCESS; if (unlikely(!(env->me_flags & MDBX_ENV_ACTIVE))) return MDBX_EPERM; - if (sizeof(value) > sizeof(size_t) && unlikely(value != (size_t)value)) + if (unlikely(value > SIZE_MAX - 65536)) return MDBX_TOO_LARGE; if (atomic_store32(&env->me_lck->mti_autosync_threshold, bytes2pgno(env, (size_t)value + env->me_psize - 1),