summaryrefslogtreecommitdiff
path: root/usr.bin/snmp/snmpc.c
diff options
context:
space:
mode:
authorMartijn van Duren <martijn@cvs.openbsd.org>2020-05-31 21:02:00 +0000
committerMartijn van Duren <martijn@cvs.openbsd.org>2020-05-31 21:02:00 +0000
commitadaf7e89c1514e08eeb567ef26888d099ad6d776 (patch)
tree3ba63de0124fb29c91c2db8728448770026d0b21 /usr.bin/snmp/snmpc.c
parent78443619e7d8cf414d7eece2de1f8adaa2b8c449 (diff)
Fix an of by one when printing the oid of the error index.
Diffstat (limited to 'usr.bin/snmp/snmpc.c')
-rw-r--r--usr.bin/snmp/snmpc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/snmp/snmpc.c b/usr.bin/snmp/snmpc.c
index 4217a223802..62fb1201a38 100644
--- a/usr.bin/snmp/snmpc.c
+++ b/usr.bin/snmp/snmpc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: snmpc.c,v 1.25 2020/05/19 13:41:01 martijn Exp $ */
+/* $OpenBSD: snmpc.c,v 1.26 2020/05/31 21:01:59 martijn Exp $ */
/*
* Copyright (c) 2019 Martijn van Duren <martijn@openbsd.org>
@@ -1098,7 +1098,7 @@ snmpc_printerror(enum snmp_error error, struct ber_element *varbind,
if (index >= 1) {
/* Only print if the index is in the reply */
- for (i = 1; varbind != NULL && i <= index;
+ for (i = 1; varbind != NULL && i < index;
varbind = varbind->be_next)
i++;
if (varbind != NULL &&