diff options
author | 2008-03-12 14:30:11 +0000 | |
---|---|---|
committer | 2008-03-12 14:30:11 +0000 | |
commit | 46f4a1b430456d038c4c4ec37a12f8e62b467ecc (patch) | |
tree | 43efdb3737d990450199169b70e2191d9188146c | |
parent | mostly stylistic - always print the client host name in snmpe error (diff) | |
download | wireguard-openbsd-46f4a1b430456d038c4c4ec37a12f8e62b467ecc.tar.xz wireguard-openbsd-46f4a1b430456d038c4c4ec37a12f8e62b467ecc.zip |
Check that the current ber element is a sequence or a set when '{' or '('
is used.
OK reyk@
-rw-r--r-- | usr.sbin/snmpd/ber.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/snmpd/ber.c b/usr.sbin/snmpd/ber.c index 5610154024d..7a573cfa9b5 100644 --- a/usr.sbin/snmpd/ber.c +++ b/usr.sbin/snmpd/ber.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ber.c,v 1.8 2008/03/12 13:09:12 claudio Exp $ */ +/* $OpenBSD: ber.c,v 1.9 2008/03/12 14:30:11 claudio Exp $ */ /* * Copyright (c) 2007 Reyk Floeter <reyk@vantronix.net> @@ -642,6 +642,9 @@ ber_scanf_elements(struct ber_element *ber, char *fmt, ...) break; case '{': case '(': + if (ber->be_encoding != BER_TYPE_SEQUENCE && + ber->be_encoding != BER_TYPE_SET) + goto fail; if (ber->be_sub == NULL || level >= _MAX_SEQ) goto fail; parent[++level] = ber; |