提交 fdfe840e 编写于 作者: O One Thousand Gnomes 提交者: Rafael J. Wysocki

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: NAlan Cox <alan@linux.intel.com>
[rjw: Subject]
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 319e2e3f
...@@ -257,7 +257,7 @@ int cmd_freq_set(int argc, char **argv) ...@@ -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;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册