From eb532b8907b22dcf9794af9874518e25416f6b03 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, 28 Mar 2022 23:43:19 +0300 Subject: [PATCH] mdbx-tools: add check for log-level. --- src/mdbx_chk.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mdbx_chk.c b/src/mdbx_chk.c index 808a088e..8dfb24f3 100644 --- a/src/mdbx_chk.c +++ b/src/mdbx_chk.c @@ -138,7 +138,8 @@ static void va_log(MDBX_log_level_t level, const char *msg, va_list args) { out = stderr; } - if (!quiet && verbose + 1 >= (unsigned)level) { + if (!quiet && verbose + 1 >= (unsigned)level && + (unsigned)level < ARRAY_LENGTH(prefixes)) { fflush(nullptr); fputs(prefixes[level], out); vfprintf(out, msg, args);