From c9df5a44d293dd47c93ab874335923f2fcaff436 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Tue, 14 May 2019 20:39:36 +0200 Subject: increased machine size in pacman.c by one fixed around letting machine not NUL-terminated when architecture is 'petntium4' --- src/pacman/pacman.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index cf30325b..b5bd2a37 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -275,8 +275,9 @@ static void setuseragent(void) int len; uname(&un); - char machine[8]; - strncpy(machine, un.machine, 8); + char machine[9]; + strncpy(machine, un.machine, sizeof machine); + machine[sizeof machine-1] = '\0'; if(strcmp(machine, "i686") == 0) { int eax, ebx, ecx, edx; __get_cpuid(1, &eax, &ebx, &ecx, &edx); -- cgit v1.2.3-70-g09d2