]> git.ipfire.org Git - location/libloc.git/commitdiff
log: Perform formatting string sanitation when logging to stderr
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 6 Mar 2025 18:10:56 +0000 (18:10 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 6 Mar 2025 18:10:56 +0000 (18:10 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libloc.c

index 5d1b87e0c7a571847edbad0e382c5fb391b24fb9..c2deed78e3b238934bb8c94be6f8afff481c08fd 100644 (file)
@@ -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) {