mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-26 16:41:25 +00:00
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>
This commit is contained in:
parent
319e2e3f63
commit
fdfe840e48
1 changed files with 1 additions and 1 deletions
|
@ -257,7 +257,7 @@ int cmd_freq_set(int argc, char **argv)
|
||||||
print_unknown_arg();
|
print_unknown_arg();
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
if ((sscanf(optarg, "%s", gov)) != 1) {
|
if ((sscanf(optarg, "%19s", gov)) != 1) {
|
||||||
print_unknown_arg();
|
print_unknown_arg();
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue