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".
This commit is contained in:
parent
3b54f5030e
commit
007b891fc7
|
@ -1654,7 +1654,7 @@ dump_uberblock(uberblock_t *ub, const char *header, const char *footer)
|
||||||
{
|
{
|
||||||
time_t timestamp = ub->ub_timestamp;
|
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("\tmagic = %016llx\n", (u_longlong_t)ub->ub_magic);
|
||||||
(void) printf("\tversion = %llu\n", (u_longlong_t)ub->ub_version);
|
(void) printf("\tversion = %llu\n", (u_longlong_t)ub->ub_version);
|
||||||
(void) printf("\ttxg = %llu\n", (u_longlong_t)ub->ub_txg);
|
(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);
|
sprintf_blkptr(blkbuf, &ub->ub_rootbp);
|
||||||
(void) printf("\trootbp = %s\n", blkbuf);
|
(void) printf("\trootbp = %s\n", blkbuf);
|
||||||
}
|
}
|
||||||
(void) printf(footer ? footer : "");
|
(void) printf("%s", footer ? footer : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in New Issue