aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUli Heilmeier <uh@heilmeier.eu>2022-02-06 10:48:38 +0100
committerA Wireshark GitLab Utility <gerald+gitlab-utility@wireshark.org>2022-02-06 18:18:21 +0000
commitbb8e3db0c6b8dc32f86561f184a00a6cf428e407 (patch)
tree20e87066333786e33f69791b42f0ba143956a5de
parentd6fe0b3211ca801ad89ae29ce1703f72d634996c (diff)
downloadwireshark-bb8e3db0c6b8dc32f86561f184a00a6cf428e407.tar.gz
wireshark-bb8e3db0c6b8dc32f86561f184a00a6cf428e407.tar.bz2
wireshark-bb8e3db0c6b8dc32f86561f184a00a6cf428e407.zip
MIH: Check length tvb_composite_append()
Check if length > 0 before calling tvb_composite_append() Related to #17890 case 3
-rw-r--r--epan/dissectors/packet-mih.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/epan/dissectors/packet-mih.c b/epan/dissectors/packet-mih.c
index 5127f9ca4c..66a63397a3 100644
--- a/epan/dissectors/packet-mih.c
+++ b/epan/dissectors/packet-mih.c
@@ -1638,7 +1638,9 @@ static void dissect_mih_tlv(tvbuff_t *tvb,int offset, proto_tree *tlv_tree, guin
for(i=0; i < mihf_id_len/2; i++)
{
tvb_temp = tvb_new_subset_length(tvb, offset + 2 + 2*i, 1);
- tvb_composite_append(tvb_mihf_id, tvb_temp);
+ if (tvb_captured_length(tvb_temp)) {
+ tvb_composite_append(tvb_mihf_id, tvb_temp);
+ }
}
TRY
{