diff options
author | Gerald Combs <gerald@wireshark.org> | 2004-06-28 22:04:12 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2004-06-28 22:04:12 +0000 |
commit | cd5f3813cbdcbfab974330f0a200b7a9d9f5eb42 (patch) | |
tree | 9a2b3147665b2c090ba7bfb9049a3774da945dd2 /packet-snmp.c | |
parent | bf6103638fc1fb5332382a55ac25516ffd4b0187 (diff) |
From Yaniv Kaul: Fix an SNMP crash bug.
svn path=/trunk/; revision=11260
Diffstat (limited to 'packet-snmp.c')
-rw-r--r-- | packet-snmp.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/packet-snmp.c b/packet-snmp.c index b91c42efbb..e579e83fea 100644 --- a/packet-snmp.c +++ b/packet-snmp.c @@ -10,7 +10,7 @@ * * See RFCs 2570-2576 for SNMPv3 * - * $Id: packet-snmp.c,v 1.127 2004/05/29 01:00:59 sahlberg Exp $ + * $Id: packet-snmp.c,v 1.128 2004/06/28 22:04:12 gerald Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -1703,6 +1703,11 @@ dissect_snmp_pdu(tvbuff_t *tvb, int offset, packet_info *pinfo, case SNMP_VERSION_2u: ret = asn1_octet_string_decode (&asn1, &community, &community_length, &length); + if (ret != ASN1_ERR_NOERROR) { + dissect_snmp_parse_error(tvb, offset, pinfo, snmp_tree, + "community (2u)", ret); + return message_length; + } if (tree) { dissect_snmp2u_parameters(snmp_tree, tvb, offset, length, community, community_length); |