diff options
author | gerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7> | 2006-07-09 22:12:02 +0000 |
---|---|---|
committer | gerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7> | 2006-07-09 22:12:02 +0000 |
commit | 9f8386d63f8fc6fb2bdeed2949795f46ca9a1227 (patch) | |
tree | 55cf0cb616310c4e42a93835a86f9ecffedaad3e /epan/dissectors/packet-snmp.c | |
parent | c7f8e7a695c637e0aaf43bf7a763fb4f9f16fdfc (diff) |
In new_format_oid(), handle a zero-length OID.
Fix a bug introduced recently in packet-rpc.c.
Replace DISSECTOR_ASSERT() with THROW(ReportedBoundsError) in my recent
checkins, since fuzz-test.sh sets WIRESHARK_ABORT_ON_DISSECTOR_BUG.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@18693 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-snmp.c')
-rw-r--r-- | epan/dissectors/packet-snmp.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/epan/dissectors/packet-snmp.c b/epan/dissectors/packet-snmp.c index 16e700a415..edb2c6b1dc 100644 --- a/epan/dissectors/packet-snmp.c +++ b/epan/dissectors/packet-snmp.c @@ -574,6 +574,11 @@ new_format_oid(subid_t *oid, guint oid_length, unsigned int i; char *buf; + if (oid == NULL || oid_length < 1) { + *decoded = NULL; + return; + } + #ifdef HAVE_SOME_SNMP guchar *oid_string; size_t oid_string_len; @@ -2699,7 +2704,7 @@ static void dissect_SMUX_PDUs_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree /*--- End of included file: packet-snmp-fn.c ---*/ -#line 1038 "packet-snmp-template.c" +#line 1043 "packet-snmp-template.c" guint dissect_snmp_pdu(tvbuff_t *tvb, int offset, packet_info *pinfo, @@ -3391,7 +3396,7 @@ void proto_register_snmp(void) { "RReqPDU/operation", HFILL }}, /*--- End of included file: packet-snmp-hfarr.c ---*/ -#line 1393 "packet-snmp-template.c" +#line 1398 "packet-snmp-template.c" }; /* List of subtrees */ @@ -3429,7 +3434,7 @@ void proto_register_snmp(void) { &ett_snmp_RReqPDU, /*--- End of included file: packet-snmp-ettarr.c ---*/ -#line 1402 "packet-snmp-template.c" +#line 1407 "packet-snmp-template.c" }; module_t *snmp_module; |