ledmon/SOURCES/0003-use-proper-format-string-with-syslog.patch

37 lines
1.1 KiB
Diff
Raw Normal View History

2019-08-02 16:03:36 +00:00
From d787b0e649df63b89e5d7b597f35caa3712ffeff Mon Sep 17 00:00:00 2001
From: Jan Synacek <jsynacek@redhat.com>
Date: Wed, 22 May 2019 14:38:37 +0200
Subject: [PATCH] use proper format string with syslog()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fixes the following:
$ CFLAGS="-Wall -Werror=format-security" make
...
ledmon.c: In function _ledmon_status:
ledmon.c:205:47: error: format not a string literal and no format arguments [-Werror=format-security]
syslog(log_level_infos[log_level].priority, message);
^~~~~~~
---
src/ledmon.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/ledmon.c b/src/ledmon.c
index bbe04fc..677af7f 100644
--- a/src/ledmon.c
+++ b/src/ledmon.c
@@ -202,7 +202,7 @@ static void _ledmon_status(int status, void *arg)
if (get_log_fd() >= 0)
_log(log_level, message);
else
- syslog(log_level_infos[log_level].priority, message);
+ syslog(log_level_infos[log_level].priority, "%s", message);
}
/**
--
2.20.1