From 1c4d095dcf61dfc5de68cc58722bf3614e6221d2 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Thu, 6 Mar 2025 18:10:56 +0000 Subject: [PATCH] log: Perform formatting string sanitation when logging to stderr Signed-off-by: Michael Tremer --- src/libloc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libloc.c b/src/libloc.c index 5d1b87e..c2deed7 100644 --- a/src/libloc.c +++ b/src/libloc.c @@ -51,6 +51,10 @@ void loc_log(struct loc_ctx* ctx, va_end(args); } +static void log_stderr(struct loc_ctx* ctx, void* data, int priority, + const char* file, int line, const char* fn, const char* format, va_list args) + __attribute__((format(printf, 7, 0))); + static void log_stderr(struct loc_ctx* ctx, void* data, int priority, const char* file, int line, const char* fn, const char* format, va_list args) { -- 2.39.5