summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorGerhard Roth <gerhard@cvs.openbsd.org>2013-06-21 07:07:56 +0000
committerGerhard Roth <gerhard@cvs.openbsd.org>2013-06-21 07:07:56 +0000
commit4138936484d30a4c46be84af95086db34f73c984 (patch)
tree0adf9130b9a8660f53de9dbffd4af474956b3491 /usr.sbin
parent1c4621cd0b64b77831f763a658bad0cc240648da (diff)
Bzero() the whole key before doing an RB_FIND() because smi_oid_cmp()
looks at more members than just 'o_id'. ok reyk@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/snmpd/smi.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/snmpd/smi.c b/usr.sbin/snmpd/smi.c
index 7a225b9a769..48a07e6c5cd 100644
--- a/usr.sbin/snmpd/smi.c
+++ b/usr.sbin/snmpd/smi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smi.c,v 1.8 2012/09/17 16:43:59 reyk Exp $ */
+/* $OpenBSD: smi.c,v 1.9 2013/06/21 07:07:55 gerhard Exp $ */
/*
* Copyright (c) 2007, 2008 Reyk Floeter <reyk@openbsd.org>
@@ -124,6 +124,7 @@ smi_delete(struct oid *oid)
{
struct oid key, *value;
+ bzero(&key, sizeof(key));
bcopy(&oid->o_id, &key.o_id, sizeof(struct ber_oid));
if ((value = RB_FIND(oidtree, &smi_oidtree, &key)) != NULL &&
value == oid)
@@ -145,6 +146,7 @@ smi_insert(struct oid *oid)
if ((oid->o_flags & OID_TABLE) && oid->o_get == NULL)
fatalx("smi_insert: invalid MIB table");
+ bzero(&key, sizeof(key));
bcopy(&oid->o_id, &key.o_id, sizeof(struct ber_oid));
value = RB_FIND(oidtree, &smi_oidtree, &key);
if (value != NULL)