diff options
author | Kenny Root <kenny@the-b.org> | 2016-06-15 23:53:49 -0700 |
---|---|---|
committer | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2016-06-16 17:10:00 +0000 |
commit | 4ad428dddf2b1a7c5b2680d3372b05dfe9395b5e (patch) | |
tree | 8d827af4065796f37eac572585a96dbfb5b525e4 /epan/dissectors/packet-ssh.c | |
parent | b22e1aeb58a2e620efca1a2f1cf37f179f3773a8 (diff) |
ssh: set packet lengths correctly
Each SSH packet was being set to be the remaining length of the frame.
This change sets the packet lengths correctly for each SSH packet.
Change-Id: Id9c2331d875465cd5e6bb788d420e0025f5d496e
Reviewed-on: https://code.wireshark.org/review/15966
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-ssh.c')
-rw-r--r-- | epan/dissectors/packet-ssh.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/epan/dissectors/packet-ssh.c b/epan/dissectors/packet-ssh.c index 31a33feda5..53bd322ccc 100644 --- a/epan/dissectors/packet-ssh.c +++ b/epan/dissectors/packet-ssh.c @@ -437,6 +437,7 @@ ssh_dissect_ssh2(tvbuff_t *tvb, packet_info *pinfo, gboolean *need_desegmentation) { proto_item *ssh2_tree=NULL; + int last_offset=offset; struct ssh_peer_data *peer_data = &global_data->peer_data[is_response]; @@ -475,6 +476,10 @@ ssh_dissect_ssh2(tvbuff_t *tvb, packet_info *pinfo, &global_data->peer_data[is_response], offset, ssh2_tree); } + if (ssh2_tree) { + proto_item_set_len(ssh2_tree, offset - last_offset); + } + return offset; } static int @@ -684,7 +689,7 @@ ssh_dissect_key_exchange(tvbuff_t *tvb, packet_info *pinfo, proto_tree_add_uint(tree, hf_ssh_padding_length, tvb, offset, 1, padding_length); offset += 1; - key_ex_tree=proto_tree_add_subtree(tree, tvb, offset, -1, ett_key_exchange, NULL, "Key Exchange"); + key_ex_tree=proto_tree_add_subtree(tree, tvb, offset, plen-1, ett_key_exchange, NULL, "Key Exchange"); /* msg_code */ msg_code = tvb_get_guint8(tvb, offset); |