Skip to content

Commit

Permalink
tools/power turbostat: fix possible sprintf buffer overflow
Browse files Browse the repository at this point in the history
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Len Brown committed Jun 1, 2018
1 parent fd3933c commit 46c2797
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/power/x86/turbostat/turbostat.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 46c2797

Please sign in to comment.