]> rtime.felk.cvut.cz Git - coffee/mt-apps.git/commitdiff
mt_server: Use "%s" format string in syslog() master
authorMichal Sojka <michal.sojka@cvut.cz>
Sun, 2 Aug 2020 18:52:17 +0000 (20:52 +0200)
committerMichal Sojka <michal.sojka@cvut.cz>
Sun, 2 Aug 2020 18:52:17 +0000 (20:52 +0200)
This fixes potential security problem reported by
-Werror=format-security:

    error: format not a string literal and no format arguments

mt_server.c

index ee80d87a7f73a9ac251653369b02339963be2b76..3b617bd68eea29d53d2b6b353337e4f3ec7ec3d4 100644 (file)
@@ -229,7 +229,7 @@ static void fd_cb(EV_P_ ev_io *w_, int revents)
        mt_blank_wake();
 #endif
         *pos = 0;
-       syslog(LOG_INFO, w->text);
+       syslog(LOG_INFO, "%s", w->text);
         char *line = new_line();
         if (line) {
             if (list_add(w->lines, w->text) == 0) {