From dd9ba2c769f020c214d41f74acc74461971e24c2 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: Mon, 13 May 2024 21:18:30 +0300 Subject: [PATCH] =?UTF-8?q?mdbx:=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=BD=D0=B0=20=D0=BD=D0=BE=D0=BB=D1=8C=20=D0=B4?= =?UTF-8?q?=D0=BE=D0=BF=D0=BE=D0=BB=D0=BD=D0=B8=D1=82=D0=B5=D0=BB=D1=8C?= =?UTF-8?q?=D0=BD=D1=8B=D1=85=20=D0=B8=20=D0=BF=D0=BE=D0=BA=D0=B0=20=D0=BD?= =?UTF-8?q?=D0=B5=20=D0=B8=D1=81=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D1=83=D0=B5?= =?UTF-8?q?=D0=BC=D1=8B=D1=85=20=D0=BF=D0=BE=D0=BB=D0=B5=D0=B9=20=D0=B2=20?= =?UTF-8?q?meta-=D1=81=D1=82=D1=80=D0=B0=D0=BD=D0=B8=D1=86=D0=B0=D1=85.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/core.c b/src/core.c index e34952ef..4a230101 100644 --- a/src/core.c +++ b/src/core.c @@ -12232,6 +12232,22 @@ static int validate_meta(MDBX_env *env, MDBX_meta *const meta, return MDBX_RESULT_TRUE; } + if (unlikely(meta->mm_extra_flags != 0)) { + WARNING("meta[%u] has unsupported %s 0x%x, skip it", meta_number, + "extra-flags", meta->mm_extra_flags); + return MDBX_RESULT_TRUE; + } + if (unlikely(meta->mm_validator_id != 0)) { + WARNING("meta[%u] has unsupported %s 0x%x, skip it", meta_number, + "validator-id", meta->mm_validator_id); + return MDBX_RESULT_TRUE; + } + if (unlikely(meta->mm_extra_pagehdr != 0)) { + WARNING("meta[%u] has unsupported %s 0x%x, skip it", meta_number, + "extra-pageheader", meta->mm_extra_pagehdr); + return MDBX_RESULT_TRUE; + } + /* LY: check signature as a checksum */ if (META_IS_STEADY(meta) && unlikely(unaligned_peek_u64(4, &meta->mm_sign) != meta_sign(meta))) {