diff options
author | Peter Wu <peter@lekensteyn.nl> | 2018-06-26 15:15:44 -0700 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2018-06-27 00:34:22 +0000 |
commit | 13150c9564ccd5d5704a0e7bffa35b0ad6e4aea9 (patch) | |
tree | b3b154884b11949ba84b5bf69ec18cae1445e0b9 /epan/dissectors/packet-exported_pdu.c | |
parent | d3b4f1980e066b832cf8e09eee2ca4ca91a7c118 (diff) |
Exported PDU: adjust protocol and tag tree lengths
Change the exported_pdu size from two to the full size of the tag
(including type and length fields) and limit the protocol length to just
the tags (without the PDU data).
Change-Id: I1c20740627ebd74c117bb1735ff4c189d2d750d6
Reviewed-on: https://code.wireshark.org/review/28470
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-exported_pdu.c')
-rw-r--r-- | epan/dissectors/packet-exported_pdu.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/epan/dissectors/packet-exported_pdu.c b/epan/dissectors/packet-exported_pdu.c index 6ce1aca29f..e3de07157a 100644 --- a/epan/dissectors/packet-exported_pdu.c +++ b/epan/dissectors/packet-exported_pdu.c @@ -165,7 +165,7 @@ static port_type exp_pdu_old_to_new_port_type(guint type) static int dissect_exported_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { - proto_item *ti, *item; + proto_item *exported_pdu_ti, *ti, *item; proto_tree *exported_pdu_tree, *tag_tree; tvbuff_t * payload_tvb = NULL; int offset = 0; @@ -185,8 +185,8 @@ dissect_exported_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* col_set_str(pinfo->cinfo, COL_PROTOCOL, "Exported PDU"); /* create display subtree for the protocol */ - ti = proto_tree_add_item(tree, proto_exported_pdu, tvb, offset, -1, ENC_NA); - exported_pdu_tree = proto_item_add_subtree(ti, ett_exported_pdu); + exported_pdu_ti = proto_tree_add_item(tree, proto_exported_pdu, tvb, offset, -1, ENC_NA); + exported_pdu_tree = proto_item_add_subtree(exported_pdu_ti, ett_exported_pdu); do { tag = tvb_get_ntohs(tvb, offset); @@ -195,6 +195,7 @@ dissect_exported_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* tag_tree = proto_item_add_subtree(ti, ett_exported_pdu_tag); proto_tree_add_item(tag_tree, hf_exported_pdu_tag_len, tvb, offset, 2, ENC_BIG_ENDIAN); tag_len = tvb_get_ntohs(tvb, offset); + proto_item_set_len(ti, 4 + tag_len); offset+=2; switch(tag) { @@ -326,6 +327,9 @@ dissect_exported_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* } while(tag != 0); + /* Limit the Exported PDU tree to the tags without payload. */ + proto_item_set_len(exported_pdu_ti, offset); + payload_tvb = tvb_new_subset_remaining(tvb, offset); proto_tree_add_item(exported_pdu_tree, hf_exported_pdu_exported_pdu, payload_tvb, 0, -1, ENC_NA); |