summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorJacob Garber <jgarber1@ualberta.ca>2019-07-01 11:04:41 -0600
committerMartin Roth <martinroth@google.com>2019-07-16 16:25:11 +0000
commit198c2e63ac964364158366468f8db5f8390494c0 (patch)
treedee26cbc4d4f5982948fd912fe6f12fd8cf8ab20 /util
parent7ed704d73d4027f33b5445b12a56af45dab2e989 (diff)
util/inteltool: Shrink buffer size
512 bytes is much too big for this buffer, which only needs to hold a path that will have a length of at most 20. The large buffer size also triggers a -Wformat-truncation warning with GCC since it is later printed into the smaller temp_string array, so shrink it down to something reasonable. Change-Id: I6a136d1a739c782b368d5035db9bc25cf5b9599b Signed-off-by: Jacob Garber <jgarber1@ualberta.ca> Reviewed-on: https://review.coreboot.org/c/coreboot/+/33944 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr> Reviewed-by: David Hendricks <david.hendricks@gmail.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Diffstat (limited to 'util')
-rw-r--r--util/inteltool/cpu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/inteltool/cpu.c b/util/inteltool/cpu.c
index ff69b8cf69..d2c8ede2ca 100644
--- a/util/inteltool/cpu.c
+++ b/util/inteltool/cpu.c
@@ -110,7 +110,7 @@ static msr_t rdmsr(int addr)
static int open_and_seek(int cpu, unsigned long msr, int mode, int *fd)
{
- char dev[512];
+ char dev[32];
char temp_string[50];
snprintf(dev, sizeof(dev), "/dev/cpu/%d/msr", cpu);