aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-per.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2013-12-19 09:19:33 +0000
committerGuy Harris <guy@alum.mit.edu>2013-12-19 09:19:33 +0000
commit317b82898664af0f0fe71c513995bb137d0a3c57 (patch)
tree37b1f0304675d62189eebd6faaa8d8383eba893e /epan/dissectors/packet-per.c
parent4a346b71882c782cf070e382a4bf718150b192d8 (diff)
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
Diffstat (limited to 'epan/dissectors/packet-per.c')
-rw-r--r--epan/dissectors/packet-per.c5
1 files changed, 1 insertions, 4 deletions
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;