fix gcc format security errors
authorHauke Mehrtens <hauke@hauke-m.de>
Sun, 22 Nov 2015 14:43:09 +0000 (15:43 +0100)
committerJohn Crispin <blogic@openwrt.org>
Sun, 22 Nov 2015 15:38:24 +0000 (16:38 +0100)
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
autofs.c
log.c

index 5f8810e8f0c82609c375f9c4bbf158379c42f58d..4ad782d6adc0da54cc3bb7fcd94f4ece29175eb5 100644 (file)
--- a/autofs.c
+++ b/autofs.c
@@ -194,7 +194,7 @@ static void autofs_init(void)
        p = ucix_get_option(ctx, "mountd", "mountd", "path");
        ucix_cleanup(ctx);
        if(p)
-               snprintf(uci_path, 31, p);
+               snprintf(uci_path, 31, "%s", p);
        else
                snprintf(uci_path, 31, "/tmp/mounts/");
        uci_path[31] = '\0';
diff --git a/log.c b/log.c
index ae7a7c96d6a0ece59406b86648cd97bab55a77d6..8ef4d5a4b20956038ad7e1eeb7b1d3e9a3b90600 100644 (file)
--- a/log.c
+++ b/log.c
@@ -26,7 +26,7 @@ void log_printf(char *fmt, ...)
        va_end(ap);
 
        if(daemonize)
-               syslog(10, p);
+               syslog(10, "%s", p);
        else
-               printf(p);
+               printf("%s", p);
 }