From 1b046b76f3ec43d2467f8121a98d0b61d3f31c12 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Tue, 25 Feb 2014 10:59:31 -0800 Subject: [PATCH] The UMTS GTP QoS Profile is a UTF-8-encoded string. So use tvb_get_string_enc() with ENC_UTF_8|ENC_NA. Use tvb_reported_length() while we're at it. Change-Id: I75bfa9abb23ca411dca5844dd56fe062d16319e0 Reviewed-on: https://code.wireshark.org/review/380 Reviewed-by: Guy Harris --- epan/dissectors/packet-gtp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epan/dissectors/packet-gtp.c b/epan/dissectors/packet-gtp.c index 1733333913..2534619fb7 100644 --- a/epan/dissectors/packet-gtp.c +++ b/epan/dissectors/packet-gtp.c @@ -4235,7 +4235,7 @@ decode_qos_umts(tvbuff_t * tvb, int offset, proto_tree * tree, const gchar * qos utf8_type = 2; /* The field in the RADIUS message is the length of the tvb we were given */ - length = tvb_length(tvb); + length = tvb_reported_length(tvb); te = proto_tree_add_text(tree, tvb, offset, length, "%s", qos_str); ext_tree_qos = proto_item_add_subtree(te, ett_gtp_qos); @@ -4602,7 +4602,7 @@ static const gchar * dissect_radius_qos_umts(proto_tree * tree, tvbuff_t * tvb, packet_info* pinfo _U_) { decode_qos_umts(tvb, 0, tree, "UMTS GTP QoS Profile", 3); - return (gchar *)tvb_memdup(wmem_packet_scope(), tvb, 0, tvb_length(tvb)); + return tvb_get_string_enc(wmem_packet_scope(), tvb, 0, tvb_reported_length(tvb), ENC_UTF_8|ENC_NA); } #define MAX_APN_LENGTH 100