Home Home > GIT Browse > openSUSE-42.3
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Baumanis <fabian.baumanis@suse.com>2019-05-20 11:06:56 +0200
committerFabian Baumanis <fabian.baumanis@suse.com>2019-05-20 11:06:56 +0200
commit5151480f6266240478f9e53954e76ce1941d9e19 (patch)
treeae6958198d9162d3ecae212fe2ad8c780c230b1b
parenta7006e16321e47442d3941abc99110777c2e54d5 (diff)
cpupower: remove stringop-truncation waring (bsc#1119086).
-rw-r--r--patches.fixes/0001-cpupower-remove-stringop-truncation-waring.patch48
-rw-r--r--series.conf1
2 files changed, 49 insertions, 0 deletions
diff --git a/patches.fixes/0001-cpupower-remove-stringop-truncation-waring.patch b/patches.fixes/0001-cpupower-remove-stringop-truncation-waring.patch
new file mode 100644
index 0000000000..5014e4673a
--- /dev/null
+++ b/patches.fixes/0001-cpupower-remove-stringop-truncation-waring.patch
@@ -0,0 +1,48 @@
+From 8a7e2d2ea080d10a189a1d611344b0330468ebc3 Mon Sep 17 00:00:00 2001
+From: Anders Roxell <anders.roxell@linaro.org>
+Date: Tue, 28 Aug 2018 11:31:18 +0200
+Subject: [PATCH] cpupower: remove stringop-truncation waring
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+Git-commit: 8a7e2d2ea080d10a189a1d611344b0330468ebc3
+Patch-mainline: v4.20
+References: bsc#1119086
+
+The strncpy doesn't null terminate the string because the size is too
+short by one byte.
+
+parse.c: In function ‘prepare_default_config’:
+parse.c:148:2: warning: ‘strncpy’ output truncated before terminating
+ nul copying 8 bytes from a string of the same length
+ [-Wstringop-truncation]
+ strncpy(config->governor, "ondemand", 8);
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The normal method of passing the length of the destination buffer works
+correctly here.
+
+Fixes: 7fe2f6399a84 ("cpupowerutils - cpufrequtils extended with quite some features")
+Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
+Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
+Reviewed-by: Fabian Baumanis <fabian.baumanis@suse.com>
+---
+ tools/power/cpupower/bench/parse.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tools/power/cpupower/bench/parse.c b/tools/power/cpupower/bench/parse.c
+index 9ba8a44ad2a7..84caee38418f 100644
+--- a/tools/power/cpupower/bench/parse.c
++++ b/tools/power/cpupower/bench/parse.c
+@@ -145,7 +145,7 @@ struct config *prepare_default_config()
+ config->cpu = 0;
+ config->prio = SCHED_HIGH;
+ config->verbose = 0;
+- strncpy(config->governor, "ondemand", 8);
++ strncpy(config->governor, "ondemand", sizeof(config->governor));
+
+ config->output = stdout;
+
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index bca206f56a..1ecd0141c6 100644
--- a/series.conf
+++ b/series.conf
@@ -24976,6 +24976,7 @@
patches.suse/0125-bcache-split-combined-if-condition-code-into-separat.patch
patches.suse/0126-bcache-panic-fix-for-making-cache-device.patch
patches.drivers/0001-ipmi-ssif-Add-support-for-multi-part-transmit-messag.patch
+ patches.fixes/0001-cpupower-remove-stringop-truncation-waring.patch
patches.suse/ACPI-processor-Fix-the-return-value-of-acpi_processor_ids_walk.patch
patches.arch/x86-cpu-sanitize-fam6_atom-naming.patch
patches.fixes/x86-kexec-correct-kexec_backup_src_end-off-by-one-error.patch