summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorOne Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>2013-12-17 15:07:31 +0000
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-01-08 15:10:39 +0100
commitfdfe840e480c56dc1119c31bb4fcc211b1b9b46f (patch)
treea7e19557782b5ea1c72b9721da36b4e094d69aed /tools
parent319e2e3f63c348a9b66db4667efa73178e18b17d (diff)
downloadlinux-stable-fdfe840e480c56dc1119c31bb4fcc211b1b9b46f.tar.gz
linux-stable-fdfe840e480c56dc1119c31bb4fcc211b1b9b46f.tar.bz2
linux-stable-fdfe840e480c56dc1119c31bb4fcc211b1b9b46f.zip
cpupower: Fix sscanf robustness in cpufreq-set
The cpufreq-set tool has a missing length check. This is basically just correctness but still should get fixed. One of a set of sscanf problems reported by Jackie Chang Signed-off-by: Alan Cox <alan@linux.intel.com> [rjw: Subject] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/power/cpupower/utils/cpufreq-set.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/power/cpupower/utils/cpufreq-set.c b/tools/power/cpupower/utils/cpufreq-set.c
index dd1539eb8c63..a416de80c55e 100644
--- a/tools/power/cpupower/utils/cpufreq-set.c
+++ b/tools/power/cpupower/utils/cpufreq-set.c
@@ -257,7 +257,7 @@ int cmd_freq_set(int argc, char **argv)
print_unknown_arg();
return -EINVAL;
}
- if ((sscanf(optarg, "%s", gov)) != 1) {
+ if ((sscanf(optarg, "%19s", gov)) != 1) {
print_unknown_arg();
return -EINVAL;
}