From 007b891fc7c53e4e12e7a2920ee03ee12c78a6a2 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Sat, 10 Jul 2010 12:36:16 -0700 Subject: [PATCH] Fix -Werror=format-security compiler option Noticed under Ubuntu kernel builds, there were two instances where printf() was not called with a "%s" and instread directly printed the string. This can potentially result in a crash and is considered bad form by gcc. It has been fixed by adding the needed "%s". --- cmd/zdb/zdb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/zdb/zdb.c b/cmd/zdb/zdb.c index 3cc2eb8619..49f7f42139 100644 --- a/cmd/zdb/zdb.c +++ b/cmd/zdb/zdb.c @@ -1654,7 +1654,7 @@ dump_uberblock(uberblock_t *ub, const char *header, const char *footer) { time_t timestamp = ub->ub_timestamp; - (void) printf(header ? header : ""); + (void) printf("%s", header ? header : ""); (void) printf("\tmagic = %016llx\n", (u_longlong_t)ub->ub_magic); (void) printf("\tversion = %llu\n", (u_longlong_t)ub->ub_version); (void) printf("\ttxg = %llu\n", (u_longlong_t)ub->ub_txg); @@ -1666,7 +1666,7 @@ dump_uberblock(uberblock_t *ub, const char *header, const char *footer) sprintf_blkptr(blkbuf, &ub->ub_rootbp); (void) printf("\trootbp = %s\n", blkbuf); } - (void) printf(footer ? footer : ""); + (void) printf("%s", footer ? footer : ""); } static void