aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-woww.c
diff options
context:
space:
mode:
authorGtker <wireshark@gtker.com>2021-07-21 16:43:21 +0200
committerWireshark GitLab Utility <gerald+gitlab-utility@wireshark.org>2021-07-24 07:42:00 +0000
commitd5f7f80d7b72d71680ee13bbac2d1a79df404837 (patch)
tree90b0577a94acb2be315360c7a459ac9468b0fe78 /epan/dissectors/packet-woww.c
parent022b4f857fa8e7f74ff2655d99f3b467b9e91ce2 (diff)
WOWW: Make tree only take the data that belongs to it
Previously, any remaining data would be highlighted as belonging to the first opcode.
Diffstat (limited to 'epan/dissectors/packet-woww.c')
-rw-r--r--epan/dissectors/packet-woww.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/epan/dissectors/packet-woww.c b/epan/dissectors/packet-woww.c
index 5853b9a779..5e2771c4ed 100644
--- a/epan/dissectors/packet-woww.c
+++ b/epan/dissectors/packet-woww.c
@@ -2096,7 +2096,11 @@ add_header_to_tree(guint8 decrypted_header[],
packet_info* pinfo,
guint8 headerSize)
{
- proto_tree* ti = proto_tree_add_item(tree, proto_woww, tvb, 0, -1, ENC_NA);
+ const guint16 size_field_width = 2;
+ // Size field does not count in the reported size, so we need to add it.
+ const guint16 packet_size = (decrypted_header[0] << 8 | decrypted_header[1]) + size_field_width;
+
+ proto_tree* ti = proto_tree_add_item(tree, proto_woww, tvb, 0, packet_size, ENC_NA);
proto_tree* woww_tree = proto_item_add_subtree(ti, ett_woww);
@@ -2106,7 +2110,7 @@ add_header_to_tree(guint8 decrypted_header[],
// We're indexing into another tvb
gint offset = 0;
- gint len = 2;
+ gint len = size_field_width;
proto_tree_add_item(woww_tree, hf_woww_size_field, next_tvb,
offset, len, ENC_BIG_ENDIAN);
offset += len;