diff options
author | Bret Lambert <blambert@cvs.openbsd.org> | 2013-10-19 14:18:40 +0000 |
---|---|---|
committer | Bret Lambert <blambert@cvs.openbsd.org> | 2013-10-19 14:18:40 +0000 |
commit | 5381202df5165cc09c51e6fa51603a28bd853421 (patch) | |
tree | b40758c5494b9eff5a9cb3bd196e0721c65d7de6 /usr.sbin | |
parent | 1c4c6d7c9514fdf734d5231a17c7de5c056bfba9 (diff) |
Fix receipt of OID varbinds when sending traps
ok reyk@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/snmpd/trap.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/snmpd/trap.c b/usr.sbin/snmpd/trap.c index 9045c47e763..5c3ca65eecd 100644 --- a/usr.sbin/snmpd/trap.c +++ b/usr.sbin/snmpd/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.20 2013/10/01 12:41:48 reyk Exp $ */ +/* $OpenBSD: trap.c,v 1.21 2013/10/19 14:18:39 blambert Exp $ */ /* * Copyright (c) 2008 Reyk Floeter <reyk@openbsd.org> @@ -101,8 +101,9 @@ trap_imsg(struct imsgev *iev, pid_t pid) switch (sm->snmp_type) { case SNMP_OBJECT: - if (sm->snmp_len != sizeof(ostr)) + if (sm->snmp_len > sizeof(ostr) - 1) goto imsgdone; + bzero(&ostr, sizeof(ostr)); bcopy(sm + 1, &ostr, sm->snmp_len); a = ber_add_oidstring(a, ostr); break; |