[alsa-devel] [PATCH 6/8] Fix build errors caused by -Werror=format-security.

Jordi Mallach jordi at debian.org
Wed May 15 19:19:09 CEST 2013


When compiled with hardening-flags enabled, ld10k1 fails to build due to
a pair of unsafe printf usages that trigger -Werror=format-security.

Signed-off-by: Jordi Mallach <jordi at debian.org>
---
 ld10k1/src/ld10k1.c |    2 +-
 ld10k1/src/lo10k1.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ld10k1/src/ld10k1.c b/ld10k1/src/ld10k1.c
index 7359f13..e31c5af 100644
--- a/ld10k1/src/ld10k1.c
+++ b/ld10k1/src/ld10k1.c
@@ -62,7 +62,7 @@ static void vlog(const char *label, const char *fmt, va_list va)
 			 localtime(&tp));
 		fprintf(out, "%s %s", timestr, label);
 	} else 
-		fprintf(out, label);
+		fprintf(out, "%s", label);
 	vfprintf(out, fmt, va);
 	fprintf(out, "\n");
 	fflush(out);
diff --git a/ld10k1/src/lo10k1.c b/ld10k1/src/lo10k1.c
index 3d04405..962c3ef 100644
--- a/ld10k1/src/lo10k1.c
+++ b/ld10k1/src/lo10k1.c
@@ -868,7 +868,7 @@ err:
 
 void debug_print(char *str)
 {
-	printf(str);
+	printf("%s", str);
 }
 
 static int debug(int deb)
-- 
1.7.10.4



More information about the Alsa-devel mailing list