From 677d24732a6a22725fe0809bbfc34c21416a5fb7 Mon Sep 17 00:00:00 2001 From: yangfeng Date: Mon, 22 Sep 2025 10:54:16 +0800 Subject: [PATCH] fix(esp_coex): fix explicit null dereferenced reported by coverity --- components/esp_coex/src/lib_printf.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/esp_coex/src/lib_printf.c b/components/esp_coex/src/lib_printf.c index a8429225b4..deba728912 100644 --- a/components/esp_coex/src/lib_printf.c +++ b/components/esp_coex/src/lib_printf.c @@ -38,13 +38,15 @@ static int lib_printf(const char* tag, const char* format, va_list arg) if (i > 0) { ESP_LOGI(tag, "%s", temp); } - va_end(arg); return len; } int coexist_printf(const char* format, ...) { - va_list arg = {}; + va_list arg; + /* coverity[uninit_use_in_call] + Event uninit_use_in_call: Using uninitialized value arg when calling __builtin_c23_va_start. + False-positive: arg will be initialized in the function va_start() */ va_start(arg, format); int res = lib_printf("coexist", format, arg); va_end(arg);