From 198c2e63ac964364158366468f8db5f8390494c0 Mon Sep 17 00:00:00 2001 From: Jacob Garber Date: Mon, 1 Jul 2019 11:04:41 -0600 Subject: [PATCH] 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/33944 Tested-by: build bot (Jenkins) Reviewed-by: HAOUAS Elyes Reviewed-by: David Hendricks Reviewed-by: Paul Menzel --- util/inteltool/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);