diff options
author | One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk> | 2013-12-17 10:07:31 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-01-08 09:10:39 -0500 |
commit | fdfe840e480c56dc1119c31bb4fcc211b1b9b46f (patch) | |
tree | a7e19557782b5ea1c72b9721da36b4e094d69aed /tools/power | |
parent | 319e2e3f63c348a9b66db4667efa73178e18b17d (diff) |
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/power')
-rw-r--r-- | tools/power/cpupower/utils/cpufreq-set.c | 2 |
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) | |||
257 | print_unknown_arg(); | 257 | print_unknown_arg(); |
258 | return -EINVAL; | 258 | return -EINVAL; |
259 | } | 259 | } |
260 | if ((sscanf(optarg, "%s", gov)) != 1) { | 260 | if ((sscanf(optarg, "%19s", gov)) != 1) { |
261 | print_unknown_arg(); | 261 | print_unknown_arg(); |
262 | return -EINVAL; | 262 | return -EINVAL; |
263 | } | 263 | } |