From b15d9e4ee1f257692c6592b700ce2c583cd87d4c Mon Sep 17 00:00:00 2001 From: Ilia Shipitsin Date: Wed, 12 Jun 2024 22:12:35 +0200 Subject: [PATCH 1/2] sources/logger.c: initialize empty_va_list found by coverity 10. var_decl: Declaring variable empty_va_list without initializer. 545 va_list empty_va_list; CID 477250: (#1 of 1): Uninitialized pointer read (UNINIT) 11. uninit_use_in_call: Using uninitialized value empty_va_list when calling od_logger_format.["show details"] --- sources/logger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/logger.c b/sources/logger.c index 77718ef78..c202a3445 100644 --- a/sources/logger.c +++ b/sources/logger.c @@ -542,7 +542,7 @@ extern void od_logger_write_plain(od_logger_t *logger, od_logger_level_t level, int len = strlen(string); char output[len + OD_LOGLINE_MAXLEN]; - va_list empty_va_list; + va_list empty_va_list = {0}; len = od_logger_format(logger, level, context, client, server, string, empty_va_list, output, len + 100); From 252465dc1cd18aeb77b41a670301a7d563b301a7 Mon Sep 17 00:00:00 2001 From: Ilia Shipitsin Date: Wed, 12 Jun 2024 22:16:00 +0200 Subject: [PATCH 2/2] ok, clang-format --- sources/logger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/logger.c b/sources/logger.c index c202a3445..9fb6a3494 100644 --- a/sources/logger.c +++ b/sources/logger.c @@ -542,7 +542,7 @@ extern void od_logger_write_plain(od_logger_t *logger, od_logger_level_t level, int len = strlen(string); char output[len + OD_LOGLINE_MAXLEN]; - va_list empty_va_list = {0}; + va_list empty_va_list = { 0 }; len = od_logger_format(logger, level, context, client, server, string, empty_va_list, output, len + 100);