mpeg-descriptor: Ensure language code is valid UTF-8

Use tvb_get_string_enc to get the 3 character language code
when adding to the subtree.

Fix #18523
This commit is contained in:
John Thacker 2022-10-21 08:20:22 -04:00
parent 8514eb0e21
commit be992b94a1
1 changed files with 2 additions and 5 deletions

View File

@ -2803,15 +2803,12 @@ proto_mpeg_descriptor_dissect_multilng_bouquet_name_desc(tvbuff_t *tvb, guint of
while (cnt > 0)
{
guint8 lng[4];
guint8* lng;
proto_tree * lng_tree;
if (cnt < 3) return;
guint lng_len = proto_mpeg_descriptor_dissect_multilng_bouquet_name_desc_measure_lng_len(tvb, offset, cnt);
lng[0] = tvb_get_guint8(tvb, offset + 0);
lng[1] = tvb_get_guint8(tvb, offset + 1);
lng[2] = tvb_get_guint8(tvb, offset + 2);
lng[3] = 0;
lng = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, 3, ENC_ASCII);
lng_tree = proto_tree_add_subtree_format(tree, tvb, offset, lng_len,
ett_mpeg_descriptor_multilng_bouquet_name_desc_lng, NULL, "Language \"%s\"", lng);