From 317b82898664af0f0fe71c513995bb137d0a3c57 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Thu, 19 Dec 2013 09:19:33 +0000 Subject: Use proto_tree_add_item() or tvb_get_string_enc() instead of tvb_get_unicode_string(). If there's an indication that the encoding is UCS-2, use that, otherwise use UTF-16. (For example, "BMP" stands for "Basic Multilingual Plane", which is the part of Unicode that can be encoded in 16 bits, hence UCS-2.) In the description of the "Use Heuristics for UDP" preference for the XML dissector, note that it's not just trying to recognize XML in UCS-2, it's trying to recognize XML in *big-endian* UCS-2. svn path=/trunk/; revision=54245 --- epan/dissectors/packet-per.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'epan/dissectors/packet-per.c') diff --git a/epan/dissectors/packet-per.c b/epan/dissectors/packet-per.c index dc9467926a..cdc5e449e9 100644 --- a/epan/dissectors/packet-per.c +++ b/epan/dissectors/packet-per.c @@ -785,7 +785,6 @@ guint32 dissect_per_BMPString(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, int min_len, int max_len, gboolean has_extension _U_) { guint32 length; - static char *str; /* xx.x if the length is 0 bytes there will be no encoding */ if(max_len==0){ @@ -816,9 +815,7 @@ dissect_per_BMPString(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tre length=1024; } - str = tvb_get_unicode_string(wmem_packet_scope(), tvb, offset>>3, length*2, ENC_BIG_ENDIAN); - - proto_tree_add_string(tree, hf_index, tvb, offset>>3, length*2, str); + proto_tree_add_item(tree, hf_index, tvb, offset>>3, length*2, ENC_UCS_2|ENC_BIG_ENDIAN); offset+=(length<<3)*2; -- cgit v1.2.3