summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2017-12-08 23:38:17 +0100
committerLen Brown <len.brown@intel.com>2018-06-01 23:14:56 +0200
commit46c2797826cc6d1ae36fcbd966e76f9fa1907eef (patch)
tree3f82fdb109ff607bb7ee310477407e681e3fbb35 /tools
parenttools/power turbostat: fix MSR_IA32_MISC_ENABLE MWAIT printout (diff)
downloadlinux-46c2797826cc6d1ae36fcbd966e76f9fa1907eef.tar.xz
linux-46c2797826cc6d1ae36fcbd966e76f9fa1907eef.zip
tools/power turbostat: fix possible sprintf buffer overflow
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/power/x86/turbostat/turbostat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
index 32f3a33a9850..59742600b7eb 100644
--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -1529,7 +1529,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",