OSDN Git Service

cpufreq: Use scnprintf() for avoiding potential buffer overflow
authorTakashi Iwai <tiwai@suse.de>
Wed, 11 Mar 2020 07:13:41 +0000 (08:13 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sat, 14 Mar 2020 11:07:38 +0000 (12:07 +0100)
commit3c0897c180c6605ebbdfa1b4badc71e181fc4cdc
tree80430012918fa2ac2f0c83ff6b86687ea598d2bf
parentc1f59a3782ee00a92849cb64e15fa6480620f281
cpufreq: Use scnprintf() for avoiding potential buffer overflow

Since snprintf() returns the would-be-output size instead of the
actual output size, the succeeding calls may go beyond the given
buffer limit.  Fix it by replacing with scnprintf().

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/cpufreq_stats.c