提交 99871a71 编写于 作者: E Eduardo Valentin 提交者: Zhang Rui

thermal: cpu_cooling: use snprintf instead of sprintf

Limit the amount of bytes written to dev_name by
secure writing with snprintf.
Signed-off-by: NEduardo Valentin <eduardo.valentin@ti.com>
Acked-by: NAmit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: NZhang Rui <rui.zhang@intel.com>
上级 135266b4
......@@ -458,7 +458,8 @@ struct thermal_cooling_device *cpufreq_cooling_register(
return ERR_PTR(-EINVAL);
}
sprintf(dev_name, "thermal-cpufreq-%d", cpufreq_dev->id);
snprintf(dev_name, sizeof(dev_name), "thermal-cpufreq-%d",
cpufreq_dev->id);
cool_dev = thermal_cooling_device_register(dev_name, cpufreq_dev,
&cpufreq_cooling_ops);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册