procps/0041-vmstat-Fixing-format-security-flaws.patch

47 lines
1.2 KiB
Diff

From dc072aced7250fed9b01fb05f0d672678752a63e Mon Sep 17 00:00:00 2001
From: Jaromir Capik <jcapik@redhat.com>
Date: Wed, 5 Feb 2014 17:09:45 +0100
Subject: [PATCH] vmstat: Fixing format-security flaws
Previously the headers were printed directly without
the format specifier. That way is considered insecure
and leads to build errors with -Werror=format-security
flag set.
---
vmstat.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git vmstat.c vmstat.c
index a84d2d2..a2fd351 100644
--- vmstat.c
+++ vmstat.c
@@ -204,10 +204,10 @@ static void new_header(void)
"%2s %2s %12s %12s %12s %12s %4s %4s %5s %5s %4s %4s %3s %3s %3s %3s %3s";
- printf(w_option ? wide_header : header);
+ printf("%s", w_option ? wide_header : header);
if (t_option) {
- printf(timestamp_header);
+ printf("%s", timestamp_header);
}
printf("\n");
@@ -528,10 +528,10 @@ static void diskheader(void)
const char wide_format[] =
"%5s %9s %9s %11s %11s %9s %9s %11s %11s %7s %7s";
- printf(w_option ? wide_header : header);
+ printf("%s", w_option ? wide_header : header);
if (t_option) {
- printf(timestamp_header);
+ printf("%s", timestamp_header);
}
printf("\n");
--
1.7.9.2