From 26d576d8fd3874ca79bfca627a9eccee1ab8ce78 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Sun, 9 Nov 2025 11:32:35 +0100 Subject: [PATCH] thresholds: fix unittest compile warning In file included from decode.h:33, from host.h:27, from util-threshold-config.c:34: util-threshold-config.c: In function 'SCThresholdConfInitContext': util-debug.h:260:5: warning: '%s' directive argument is null [-Wformat-overflow=] 260 | SCLogErr(SC_LOG_WARNING, __FILE__, __FUNCTION__, __LINE__, _sc_module, __VA_ARGS__) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ util-threshold-config.c:190:9: note: in expansion of macro 'SCLogWarning' 190 | SCLogWarning("Error loading threshold configuration from %s", filename); | ^~~~~~~~~~~~ util-threshold-config.c:190:66: note: format string is defined here 190 | SCLogWarning("Error loading threshold configuration from %s", filename); | ^~ (cherry picked from commit 3a0f4dde0781e600b48b5c1bb3ba3761c8df997e) --- src/util-threshold-config.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/util-threshold-config.c b/src/util-threshold-config.c index e665d1ca91..9c7e175e06 100644 --- a/src/util-threshold-config.c +++ b/src/util-threshold-config.c @@ -173,6 +173,7 @@ int SCThresholdConfInitContext(DetectEngineCtx *de_ctx) #ifndef UNITTESTS FILE *fd = NULL; #else + filename = ""; FILE *fd = g_ut_threshold_fp; if (fd == NULL) { #endif