diff options
author | gerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7> | 2008-02-26 01:17:18 +0000 |
---|---|---|
committer | gerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7> | 2008-02-26 01:17:18 +0000 |
commit | da5dd5a1feff93d84e9be4dc0114b0ce3eb61177 (patch) | |
tree | 2a55dff50ea030039a22ef3b9b37de333cce3da0 /epan/dissectors/packet-snmp.c | |
parent | e5d6b66a9562e93bcb3d78152f84de4e43ec5439 (diff) |
Make sure we don't dereference a NULL pointer. Fixes bug 2277.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@24467 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-snmp.c')
-rw-r--r-- | epan/dissectors/packet-snmp.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/epan/dissectors/packet-snmp.c b/epan/dissectors/packet-snmp.c index 8221f444d2..10d7975811 100644 --- a/epan/dissectors/packet-snmp.c +++ b/epan/dissectors/packet-snmp.c @@ -892,8 +892,10 @@ set_label: oid_info->name, oid_subid2string(subids,oid_matched)); } + } else if (oid_string) { + repr = ep_strdup(oid_string); } else { - repr = ep_strdup_printf("%s", oid_string); + repr = ep_strdup("[Bad OID]"); } valstr = strstr(label,": "); @@ -2550,7 +2552,7 @@ static void dissect_SMUX_PDUs_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, pro /*--- End of included file: packet-snmp-fn.c ---*/ -#line 1388 "packet-snmp-template.c" +#line 1390 "packet-snmp-template.c" guint @@ -3328,7 +3330,7 @@ void proto_register_snmp(void) { "snmp.T_operation", HFILL }}, /*--- End of included file: packet-snmp-hfarr.c ---*/ -#line 1901 "packet-snmp-template.c" +#line 1903 "packet-snmp-template.c" }; /* List of subtrees */ @@ -3368,7 +3370,7 @@ void proto_register_snmp(void) { &ett_snmp_RReqPDU_U, /*--- End of included file: packet-snmp-ettarr.c ---*/ -#line 1917 "packet-snmp-template.c" +#line 1919 "packet-snmp-template.c" }; module_t *snmp_module; static uat_field_t users_fields[] = { |