diff options
Diffstat (limited to 'packet-snmp.c')
-rw-r--r-- | packet-snmp.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/packet-snmp.c b/packet-snmp.c index d1bd0658d0..fa6c994a4f 100644 --- a/packet-snmp.c +++ b/packet-snmp.c @@ -8,7 +8,7 @@ * * See RFCs 1905, 1906, 1909, and 1910 for SNMPv2u. * - * $Id: packet-snmp.c,v 1.61 2001/04/06 23:12:33 guy Exp $ + * $Id: packet-snmp.c,v 1.62 2001/04/07 00:52:07 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -834,7 +834,7 @@ snmp_variable_decode(proto_tree *snmp_tree, subid_t *variable_oid, if (snmp_tree) { #ifdef HAVE_SPRINT_VALUE if (!unsafe) { - variable.val.string = vb_octet_string; + variable.val.string = SAFE_STRING(vb_octet_string); vb_display_string = format_var(&variable, variable_oid, variable_oid_length, vb_type, vb_length); @@ -876,7 +876,8 @@ snmp_variable_decode(proto_tree *snmp_tree, subid_t *variable_oid, } else { proto_tree_add_text(snmp_tree, NullTVB, offset, length, "Value: %s: %.*s", vb_type_name, - (int)vb_length, vb_octet_string); + (int)vb_length, + SAFE_STRING(vb_octet_string)); } } g_free(vb_octet_string); @@ -1124,8 +1125,17 @@ dissect_common_pdu(const u_char *pd, int offset, frame_data *fd, } length = asn1.pointer - start; if (tree) { - proto_tree_add_text(tree, NullTVB, offset, length, - "Agent address: %s", ip_to_str(agent_address)); + if (agent_address_length != 4) { + proto_tree_add_text(tree, NullTVB, offset, + length, + "Agent address: <length is %u, not 4>", + agent_address_length); + } else { + proto_tree_add_text(tree, NullTVB, offset, + length, + "Agent address: %s", + ip_to_str(agent_address)); + } } g_free(agent_address); offset += length; |