diff options
author | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2018-01-15 09:16:57 +0100 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2018-01-16 05:28:54 +0000 |
commit | d3c6cdde5bf5ade070f3d3ecf66b74f32e8ad9a8 (patch) | |
tree | 1b020ad4da0fd5dd1867db94b32c7a371c0cbbc2 | |
parent | 9937973431a01b9711a17fbe8aa0d2f6f2755032 (diff) |
QUIC: fix Padding Frame
Padding frame can be anywhere on QUIC payload
Add loop check if it is always padding frame (0x00)
Bug: 13881
Change-Id: I3d50e5347aeca9738aeac3287ddba7fd30fc72b1
Reviewed-on: https://code.wireshark.org/review/25324
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r-- | epan/dissectors/packet-quic.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/epan/dissectors/packet-quic.c b/epan/dissectors/packet-quic.c index c9f5940f8a..19f82ad98c 100644 --- a/epan/dissectors/packet-quic.c +++ b/epan/dissectors/packet-quic.c @@ -619,13 +619,21 @@ dissect_quic_frame_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *quic_ switch(frame_type){ case FT_PADDING:{ proto_item *ti_pad_len; - guint32 pad_len = tvb_reported_length_remaining(tvb, offset); + guint32 padding_offset = offset, pad_len; + + /* get length of padding (with check if it is always a 0) */ + while ( tvb_reported_length_remaining(tvb, padding_offset) > 0) { + if(tvb_get_guint8(tvb, padding_offset) != 0){ + break; + } + padding_offset ++; + } + pad_len = padding_offset - offset; ti_pad_len = proto_tree_add_uint(ft_tree, hf_quic_frame_type_padding_length, tvb, offset, 0, pad_len); PROTO_ITEM_SET_GENERATED(ti_pad_len); proto_item_append_text(ti_ft, " Length: %u", pad_len); - //TODO: Add check if always 0 ? - proto_tree_add_item(ft_tree, hf_quic_frame_type_padding, tvb, offset, -1, ENC_NA); + proto_tree_add_item(ft_tree, hf_quic_frame_type_padding, tvb, offset, pad_len, ENC_NA); offset += pad_len; proto_item_set_len(ti_ft, 1+pad_len); } |