summaryrefslogtreecommitdiffstats
path: root/usr.bin/snmp
diff options
context:
space:
mode:
authormartijn <martijn@openbsd.org>2020-05-10 21:14:30 +0000
committermartijn <martijn@openbsd.org>2020-05-10 21:14:30 +0000
commit141b3f16fee0326b0758599d0b449748ffe3bfec (patch)
tree7a2e12bfdd25abe8a2a7cb940a64a4c03663f7e8 /usr.bin/snmp
parentFix two out-of-bounds array accesses in ioctl code pats. One found by (diff)
downloadwireguard-openbsd-141b3f16fee0326b0758599d0b449748ffe3bfec.tar.xz
wireguard-openbsd-141b3f16fee0326b0758599d0b449748ffe3bfec.zip
Initialize a couple of variables to shut up gcc, which apparently isn't
smart enough to see that there is a proper check in place to prevent uninitialized usage. OK deraadt@
Diffstat (limited to 'usr.bin/snmp')
-rw-r--r--usr.bin/snmp/snmpc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/snmp/snmpc.c b/usr.bin/snmp/snmpc.c
index c5173b9a1a0..3ea10d00dae 100644
--- a/usr.bin/snmp/snmpc.c
+++ b/usr.bin/snmp/snmpc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: snmpc.c,v 1.23 2020/05/08 12:21:07 martijn Exp $ */
+/* $OpenBSD: snmpc.c,v 1.24 2020/05/10 21:14:30 martijn Exp $ */
/*
* Copyright (c) 2019 Martijn van Duren <martijn@openbsd.org>
@@ -111,10 +111,10 @@ main(int argc, char *argv[])
const EVP_CIPHER *cipher = NULL;
struct snmp_sec *sec;
char *user = NULL;
- enum usm_key_level authkeylevel;
+ enum usm_key_level authkeylevel = USM_KEY_UNSET;
char *authkey = NULL;
size_t authkeylen = 0;
- enum usm_key_level privkeylevel;
+ enum usm_key_level privkeylevel = USM_KEY_UNSET;
char *privkey = NULL;
size_t privkeylen = 0;
int seclevel = SNMP_MSGFLAG_REPORT;
@@ -122,7 +122,7 @@ main(int argc, char *argv[])
char *ctxengineid = NULL, *secengineid = NULL;
size_t ctxengineidlen, secengineidlen;
int zflag = 0;
- long long boots, time;
+ long long boots = 0, time = 0;
char optstr[BUFSIZ];
const char *errstr;
char *strtolp;