aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoman Koshelev <roman.koshelev@bk.ru>2019-12-29 01:17:41 +0300
committerAnders Broman <a.broman58@gmail.com>2020-01-07 12:49:20 +0000
commitdc74cfb3f95f35c3a8f5fd8b7256254fad6f40bd (patch)
tree1815627e39b595dc9e81fc2b3a10d403798535a0
parentd95837534967bd286646c43a0db987fc08fb77ad (diff)
TFTP Header End Fix
Change-Id: I70d66bb49384f2eac865a81ffc23b76362c37191 Reviewed-on: https://code.wireshark.org/review/35578 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-tftp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/epan/dissectors/packet-tftp.c b/epan/dissectors/packet-tftp.c
index 34ac77f67c..8afb476642 100644
--- a/epan/dissectors/packet-tftp.c
+++ b/epan/dissectors/packet-tftp.c
@@ -352,6 +352,7 @@ static void dissect_tftp_message(tftp_conv_info_t *tftp_info,
proto_tree *tree)
{
proto_tree *tftp_tree;
+ proto_item *root_ti;
proto_item *ti;
proto_item *blocknum_item;
gint offset = 0;
@@ -366,8 +367,8 @@ static void dissect_tftp_message(tftp_conv_info_t *tftp_info,
col_set_str(pinfo->cinfo, COL_PROTOCOL, "TFTP");
/* Protocol root */
- ti = proto_tree_add_item(tree, proto_tftp, tvb, offset, -1, ENC_NA);
- tftp_tree = proto_item_add_subtree(ti, ett_tftp);
+ root_ti = proto_tree_add_item(tree, proto_tftp, tvb, offset, -1, ENC_NA);
+ tftp_tree = proto_item_add_subtree(root_ti, ett_tftp);
/* Opcode */
opcode = tvb_get_ntohs(tvb, offset);
@@ -453,6 +454,7 @@ static void dissect_tftp_message(tftp_conv_info_t *tftp_info,
break;
case TFTP_DATA:
+ proto_item_set_len(root_ti, 4);
blocknum_item = proto_tree_add_item_ret_uint(tftp_tree, hf_tftp_blocknum, tvb, offset, 2,
ENC_BIG_ENDIAN, &blocknum);