summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2008-03-12 13:12:43 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2008-03-12 13:12:43 +0000
commit0d8ed07949aa213c730e1a53da2f1fd073ccb61c (patch)
tree1aefcf6625a17d628cbe925b7e244426a975bdd8 /usr.sbin
parent5a22b0c27bb2da700052d29a6d75a2a7afb2e196 (diff)
if (class != BER_CLASS_UNIVERSAL || type != BER_TYPE_SEQUENCE)
not if (class != BER_CLASS_UNIVERSAL && type != BER_TYPE_SEQUENCE) the class and type need to be of correct. OK reyk@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/snmpd/snmpe.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/snmpd/snmpe.c b/usr.sbin/snmpd/snmpe.c
index 857b3a33fb6..3b2a9cd7038 100644
--- a/usr.sbin/snmpd/snmpe.c
+++ b/usr.sbin/snmpd/snmpe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: snmpe.c,v 1.16 2008/02/09 13:03:01 reyk Exp $ */
+/* $OpenBSD: snmpe.c,v 1.17 2008/03/12 13:12:42 claudio Exp $ */
/*
* Copyright (c) 2007, 2008 Reyk Floeter <reyk@vantronix.net>
@@ -572,7 +572,7 @@ snmpe_parse(struct sockaddr_storage *ss,
log_debug("invalid PDU");
return (-1);
}
- if (class != BER_CLASS_UNIVERSAL && type != BER_TYPE_SEQUENCE) {
+ if (class != BER_CLASS_UNIVERSAL || type != BER_TYPE_SEQUENCE) {
stats->snmp_silentdrops++;
log_debug("invalid varbind");
return (-1);
@@ -592,9 +592,9 @@ snmpe_parse(struct sockaddr_storage *ss,
a != NULL && i < SNMPD_MAXVARBIND; a = next, i++) {
next = a->be_next;
- if (a->be_class != BER_CLASS_UNIVERSAL &&
+ if (a->be_class != BER_CLASS_UNIVERSAL ||
a->be_type != BER_TYPE_SEQUENCE)
- goto varfail;
+ continue;
if ((b = a->be_sub) == NULL)
continue;
for (state = 0; state < 2 && b != NULL; b = b->be_next) {