aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-sua.c
diff options
context:
space:
mode:
authorJoão Valverde <j@v6e.pt>2022-10-26 10:53:26 +0100
committerJoão Valverde <j@v6e.pt>2022-10-26 11:14:06 +0100
commit0157d74c442dabb5f1ea5ba6383910d1f0a8de36 (patch)
treef75969fa0eed72d193253612f72a3a66ade4febf /epan/dissectors/packet-sua.c
parent40ec1adfb06b463292c52a586fffef190e9cc8f7 (diff)
epan: Fix bogus string truncations found with a search
Fix some unnecessary string truncations that look bogus to me. Forcing a given UTF-8 byte length for no reason will in most cases produce encoding errors. Fixes #18548.
Diffstat (limited to 'epan/dissectors/packet-sua.c')
-rw-r--r--epan/dissectors/packet-sua.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/epan/dissectors/packet-sua.c b/epan/dissectors/packet-sua.c
index 09f4095227..18768d94e4 100644
--- a/epan/dissectors/packet-sua.c
+++ b/epan/dissectors/packet-sua.c
@@ -591,7 +591,7 @@ dissect_info_string_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, proto
}
proto_tree_add_item(parameter_tree, hf_sua_info_string, parameter_tvb, INFO_STRING_OFFSET, info_string_length, ENC_UTF_8);
- proto_item_append_text(parameter_item, " (%.*s)", info_string_length,
+ proto_item_append_text(parameter_item, " (%s)",
tvb_format_text(pinfo->pool, parameter_tvb, INFO_STRING_OFFSET, info_string_length));
}
@@ -1494,8 +1494,8 @@ dissect_hostname_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree,
guint16 hostname_length;
hostname_length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET) - PARAMETER_HEADER_LENGTH;
- proto_tree_add_item(parameter_tree, source ? hf_sua_source_hostname : hf_sua_dest_hostname, parameter_tvb, HOSTNAME_OFFSET, hostname_length, ENC_ASCII|ENC_NA);
- proto_item_append_text(parameter_item, " (%.*s)", hostname_length,
+ proto_tree_add_item(parameter_tree, source ? hf_sua_source_hostname : hf_sua_dest_hostname, parameter_tvb, HOSTNAME_OFFSET, hostname_length, ENC_ASCII);
+ proto_item_append_text(parameter_item, " (%s)",
tvb_format_text(wmem_packet_scope(), parameter_tvb, HOSTNAME_OFFSET, hostname_length));
}