diff options
author | 2013-06-21 07:07:55 +0000 | |
---|---|---|
committer | 2013-06-21 07:07:55 +0000 | |
commit | f22c8f53de8086001f28dc0b12aed23ed8388f51 (patch) | |
tree | fd42c32cbf1ea1fe43d744c0e22fba88c4d8e96e | |
parent | The bind lock must only be grabbed with all signals masked. (diff) | |
download | wireguard-openbsd-f22c8f53de8086001f28dc0b12aed23ed8388f51.tar.xz wireguard-openbsd-f22c8f53de8086001f28dc0b12aed23ed8388f51.zip |
Bzero() the whole key before doing an RB_FIND() because smi_oid_cmp()
looks at more members than just 'o_id'.
ok reyk@
-rw-r--r-- | usr.sbin/snmpd/smi.c | 4 |
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) |