aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2005-12-08 23:21:26 +0000
committerGuy Harris <guy@alum.mit.edu>2005-12-08 23:21:26 +0000
commita770b7b647b382ea5232be245e38a2433950ad80 (patch)
tree8149beb51072f5f712b9057d314f47a73a843a8a /epan
parentaaf8a3060d2d4df23420189ecd50c9be2c3654aa (diff)
"get_oid_name()" can return a null pointer; don't try to add the name if
it does. svn path=/trunk/; revision=16735
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-ber.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/epan/dissectors/packet-ber.c b/epan/dissectors/packet-ber.c
index 633e5b51e2..88cb972025 100644
--- a/epan/dissectors/packet-ber.c
+++ b/epan/dissectors/packet-ber.c
@@ -1736,6 +1736,7 @@ int dissect_ber_object_identifier(gboolean implicit_tag, packet_info *pinfo, pro
char *str;
proto_item *item = NULL;
header_field_info *hfi;
+ const gchar *name;
#ifdef DEBUG_BER
{
@@ -1777,10 +1778,12 @@ printf("OBJECT IDENTIFIER dissect_ber_object_identifier(%s) entered\n",name);
} else if (IS_FT_STRING(hfi->type)) {
str = oid_to_str(tvb_get_ptr(tvb, offset, len), len);
item = proto_tree_add_string(tree, hf_id, tvb, offset, len, str);
- /* see if we know the name of this oid */
if(item){
- proto_item_append_text(item, " (%s)",
- get_oid_name(tvb_get_ptr(tvb, offset, len), len));
+ /* see if we know the name of this oid */
+ name = get_oid_name(tvb_get_ptr(tvb, offset, len), len);
+ if(name){
+ proto_item_append_text(item, " (%s)", name);
+ }
}
} else {
DISSECTOR_ASSERT_NOT_REACHED();