Commit 3a738e7f authored by Len Brown's avatar Len Brown Committed by Greg Kroah-Hartman

tools/power turbostat: fix possible sprintf buffer overflow

commit 46c27978 upstream.
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
Cc: Alakesh Haloi <alakeshh@amazon.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent cdb2d37d
......@@ -1485,7 +1485,7 @@ int get_mp(int cpu, struct msr_counter *mp, unsigned long long *counterp)
if (get_msr(cpu, mp->msr_num, counterp))
return -1;
} else {
char path[128];
char path[128 + PATH_BYTES];
if (mp->flags & SYSFS_PERCPU) {
sprintf(path, "/sys/devices/system/cpu/cpu%d/%s",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment