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>
This commit is contained in:
parent
7ed704d73d
commit
198c2e63ac
|
@ -110,7 +110,7 @@ static msr_t rdmsr(int addr)
|
||||||
|
|
||||||
static int open_and_seek(int cpu, unsigned long msr, int mode, int *fd)
|
static int open_and_seek(int cpu, unsigned long msr, int mode, int *fd)
|
||||||
{
|
{
|
||||||
char dev[512];
|
char dev[32];
|
||||||
char temp_string[50];
|
char temp_string[50];
|
||||||
|
|
||||||
snprintf(dev, sizeof(dev), "/dev/cpu/%d/msr", cpu);
|
snprintf(dev, sizeof(dev), "/dev/cpu/%d/msr", cpu);
|
||||||
|
|
Loading…
Reference in New Issue