diff options
author | Len Brown <len.brown@intel.com> | 2017-12-08 23:38:17 +0100 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2018-06-01 23:14:56 +0200 |
commit | 46c2797826cc6d1ae36fcbd966e76f9fa1907eef (patch) | |
tree | 3f82fdb109ff607bb7ee310477407e681e3fbb35 /tools | |
parent | tools/power turbostat: fix MSR_IA32_MISC_ENABLE MWAIT printout (diff) | |
download | linux-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.c | 2 |
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", |