diff options
author | Роман Донченко <dpb@corrigendum.ru> | 2014-08-10 21:05:52 +0400 |
---|---|---|
committer | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2014-08-10 18:08:10 +0000 |
commit | e1de06f554ff4ef5566ae386ecbc242e9b87980b (patch) | |
tree | 7208583d5b32ae614f2c26c59079b7612cf5f6d2 /epan/dissectors/packet-ssh.c | |
parent | ed85bd3ff69f8c487ca3d89cd1668a052abc93a4 (diff) |
SSH: don't display "Payload" if it's empty
The "Payload" field only makes sense for packets that have unknown
type or are unexpectedly long. For normal traces, it will always be
empty, so hide it.
Note: this length check used to be implicitly performed by
ssh_proto_tree_add_item before 2aa66aa2b2daf0693e405371a5f9037a43896441,
so this just restores the former behaviour.
Change-Id: I948935bce660018377a004c661b829a19eb0a53b
Reviewed-on: https://code.wireshark.org/review/3535
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 | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/epan/dissectors/packet-ssh.c b/epan/dissectors/packet-ssh.c index 0bf294953a..f640e7ab5d 100644 --- a/epan/dissectors/packet-ssh.c +++ b/epan/dissectors/packet-ssh.c @@ -752,7 +752,9 @@ ssh_dissect_key_exchange(tvbuff_t *tvb, packet_info *pinfo, } len = plen+4-padding_length-(offset-last_offset); - proto_tree_add_item(key_ex_tree, hf_ssh_payload, tvb, offset, len, ENC_NA); + if (len > 0) { + proto_tree_add_item(key_ex_tree, hf_ssh_payload, tvb, offset, len, ENC_NA); + } offset +=len; /* padding */ |