Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2019-05-14 20:39:36 +0200
committerErich Eckner <git@eckner.net>2021-05-26 17:29:24 +0200
commitc9df5a44d293dd47c93ab874335923f2fcaff436 (patch)
treeaca970c1dc505cec9c156f924f1748314e1dcb0f /src
parent740dbbbee7b598060a9d3b51afbb9634e735b56e (diff)
increased machine size in pacman.c by oneHEADmaster
fixed around letting machine not NUL-terminated when architecture is 'petntium4'
Diffstat (limited to 'src')
-rw-r--r--src/pacman/pacman.c5
1 files changed, 3 insertions, 2 deletions
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);