aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-fcdns.c
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss@ulticom.com>2011-01-16 03:57:12 +0000
committerJeff Morriss <jeff.morriss@ulticom.com>2011-01-16 03:57:12 +0000
commit61876001c35547972282a50854957c7c4deaaccf (patch)
tree7f20cb0372c55d80a8f833d862d6cfd13a3c6a1e /epan/dissectors/packet-fcdns.c
parentd553df218ebcb9e76299592b0794f0553ed63ff7 (diff)
Replace some tvb_get_ptr()s with tvb_get_ephemeral_string()s to ensure the
return string is NULL terminated. There's no need to pass the result of tvb_get_ptr() as the 'value' in proto_tree_add_*(): just use proto_tree_add_item(). svn path=/trunk/; revision=35548
Diffstat (limited to 'epan/dissectors/packet-fcdns.c')
-rw-r--r--epan/dissectors/packet-fcdns.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/epan/dissectors/packet-fcdns.c b/epan/dissectors/packet-fcdns.c
index b02ed0648f..6932abfa98 100644
--- a/epan/dissectors/packet-fcdns.c
+++ b/epan/dissectors/packet-fcdns.c
@@ -592,9 +592,8 @@ dissect_fcdns_gspnid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
len = tvb_get_guint8 (tvb, offset);
proto_tree_add_item (req_tree, hf_fcdns_rply_spnamelen,
tvb, offset, 1, 0);
- proto_tree_add_string (req_tree, hf_fcdns_rply_spname, tvb,
- offset+1, len,
- tvb_get_ptr (tvb, offset+1, len));
+ proto_tree_add_item (req_tree, hf_fcdns_rply_spname, tvb,
+ offset+1, len, ENC_NA);
}
}
}
@@ -1256,7 +1255,7 @@ dissect_fcdns_swils_entries (tvbuff_t *tvb, proto_tree *tree, int offset)
proto_tree_add_item (tree, hf_fcdns_sw2_objfmt, tvb, offset, 1, 0);
proto_tree_add_string (tree, hf_fcdns_rply_ownerid, tvb, offset+1,
- 3, fc_to_str (tvb_get_ptr (tvb, offset+1,
+ 3, fc_to_str (tvb_get_ephemeral_string (tvb, offset+1,
3)));
proto_tree_add_item (tree, hf_fcdns_rply_ptype, tvb, offset+4,
1, 0);
@@ -1443,8 +1442,8 @@ dissect_fcdns_gezn (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
str_len = tvb_get_guint8 (tvb, offset);
proto_tree_add_text (req_tree, tvb, offset, 1, "Name Length: %d",
str_len);
- proto_tree_add_string (req_tree, hf_fcdns_zonenm, tvb, offset+3,
- str_len, tvb_get_ptr (tvb, offset+3, str_len));
+ proto_tree_add_item (req_tree, hf_fcdns_zonenm, tvb, offset+3,
+ str_len, ENC_NA);
}
}
else {