Blame SOURCES/0001-Fix-a-format-security-compilation-defect.patch

f82ed2
From 28dfbf252a31b4e8c1d0f5e038f6889b7eadfc16 Mon Sep 17 00:00:00 2001
f82ed2
From: Honggang Li <honli@redhat.com>
f82ed2
Date: Wed, 1 Apr 2020 10:52:12 +0800
f82ed2
Subject: [PATCH] Fix a format security compilation defect
f82ed2
f82ed2
subcommands.cpp:1852:42: error: format not a string literal and no format arguments [-Werror=format-security]
f82ed2
1852 | false, "N/A").c_str());
f82ed2
f82ed2
Signed-off-by: Honggang Li <honli@redhat.com>
f82ed2
---
f82ed2
 flint/subcommands.cpp | 6 +++---
f82ed2
 1 file changed, 3 insertions(+), 3 deletions(-)
f82ed2
f82ed2
diff --git a/flint/subcommands.cpp b/flint/subcommands.cpp
f82ed2
index 7230f9a59f94..0f6440be7b28 100755
f82ed2
--- a/flint/subcommands.cpp
f82ed2
+++ b/flint/subcommands.cpp
f82ed2
@@ -1847,7 +1847,7 @@ bool BurnSubCommand::checkFwVersion(bool CreateFromImgInfo, u_int16_t fw_ver0, u
f82ed2
     char curr_ver[124], new_ver[124];
f82ed2
     printf("\n");
f82ed2
     printf("    Current FW version on flash:  ");
f82ed2
-    snprintf(curr_ver, 124,
f82ed2
+    snprintf(curr_ver, 124, "%s",
f82ed2
             current.get_fw_version(VERSION_FORMAT(_devInfo.fw_info.fw_ver[1]),
f82ed2
                     false, "N/A").c_str());
f82ed2
 
f82ed2
@@ -1856,13 +1856,13 @@ bool BurnSubCommand::checkFwVersion(bool CreateFromImgInfo, u_int16_t fw_ver0, u
f82ed2
 
f82ed2
     printf("    New FW version:               ");
f82ed2
     if (CreateFromImgInfo) {
f82ed2
-        snprintf(new_ver, 124,
f82ed2
+        snprintf(new_ver, 124, "%s",
f82ed2
                 new_version.get_fw_version(
f82ed2
                         VERSION_FORMAT(_imgInfo.fw_info.fw_ver[1]), false,
f82ed2
                         "N/A").c_str());
f82ed2
     }
f82ed2
     else {
f82ed2
-        snprintf(new_ver, 124,
f82ed2
+        snprintf(new_ver, 124, "%s",
f82ed2
                 new_version.get_fw_version(VERSION_FORMAT(fw_ver1), false,
f82ed2
                         "N/A").c_str());
f82ed2
     }
f82ed2
-- 
f82ed2
2.25.1
f82ed2