diff options
-rw-r--r-- | usr.sbin/snmpd/mps.c | 6 | ||||
-rw-r--r-- | usr.sbin/snmpd/smi.c | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/usr.sbin/snmpd/mps.c b/usr.sbin/snmpd/mps.c index f30367e2cbb..09cd4f8e236 100644 --- a/usr.sbin/snmpd/mps.c +++ b/usr.sbin/snmpd/mps.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mps.c,v 1.9 2008/01/03 14:44:08 reyk Exp $ */ +/* $OpenBSD: mps.c,v 1.10 2008/01/04 12:57:40 reyk Exp $ */ /* * Copyright (c) 2007 Reyk Floeter <reyk@vantronix.net> @@ -119,6 +119,7 @@ mps_getreq(struct ber_element *root, struct ber_oid *o) smi_oidlen(o); if (o->bo_n > BER_MAX_OID_LEN) return (NULL); + bzero(&key, sizeof(key)); bcopy(o, &key.o_id, sizeof(struct ber_oid)); value = smi_find(&key); if (value == NULL) @@ -145,6 +146,7 @@ mps_setreq(struct ber_element *ber, struct ber_oid *o) smi_oidlen(o); if (o->bo_n > BER_MAX_OID_LEN) return (-1); + bzero(&key, sizeof(key)); bcopy(o, &key.o_id, sizeof(struct ber_oid)); value = smi_find(&key); if (value == NULL) @@ -167,6 +169,7 @@ mps_getnextreq(struct ber_element *root, struct ber_oid *o) smi_oidlen(o); if (o->bo_n > BER_MAX_OID_LEN) return (NULL); + bzero(&key, sizeof(key)); bcopy(o, &key.o_id, sizeof(struct ber_oid)); value = smi_find(&key); if (value == NULL) @@ -224,6 +227,7 @@ mps_set(struct ber_oid *o, void *p, long long len) smi_oidlen(o); if (o->bo_n > BER_MAX_OID_LEN) return (-1); + bzero(&key, sizeof(key)); bcopy(o, &key.o_id, sizeof(struct ber_oid)); value = smi_find(&key); if (value == NULL) diff --git a/usr.sbin/snmpd/smi.c b/usr.sbin/snmpd/smi.c index 28fc6f9cb75..b35ff3254e0 100644 --- a/usr.sbin/snmpd/smi.c +++ b/usr.sbin/snmpd/smi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smi.c,v 1.3 2008/01/02 20:54:59 maja Exp $ */ +/* $OpenBSD: smi.c,v 1.4 2008/01/04 12:57:40 reyk Exp $ */ /* * Copyright (c) 2007 Reyk Floeter <reyk@vantronix.net> @@ -85,6 +85,7 @@ smi_oidstring(struct ber_oid *o, char *buf, size_t len) size_t i, lookup = 1; bzero(buf, len); + bzero(&key, sizeof(key)); bcopy(o, &key.o_id, sizeof(struct ber_oid)); key.o_flags |= OID_KEY; /* do not match wildcards */ |