index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Andreas Baumann <mail@andreasbaumann.cc> | 2019-05-14 20:39:36 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2021-05-26 17:29:24 +0200 |
commit | c9df5a44d293dd47c93ab874335923f2fcaff436 (patch) | |
tree | aca970c1dc505cec9c156f924f1748314e1dcb0f /src | |
parent | 740dbbbee7b598060a9d3b51afbb9634e735b56e (diff) |
-rw-r--r-- | src/pacman/pacman.c | 5 |
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); |