diff options
author | Olaf Flaschel <olaf.flaschel@vestifi.de> | 2018-12-13 00:07:27 +0100 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2018-12-13 11:21:39 +0000 |
commit | dae1c3135162db7fc4adece45be612274b05d8d5 (patch) | |
tree | 99e28fae2f02f9ecd2c060eb6ee43c2cff8efa2f /epan/dissectors/packet-ieee80211.c | |
parent | 236e7e89adc49ae3c527182ab253244afe8c921e (diff) |
IEEE802.11: Prevent BoundsError for packets with captured len < packet len
This fix prevents that a BoundsError is thrown in function try_decrypt for
packets with captured length less than packet length. Otherwise, some data
is not dissected.
Change-Id: I0dcd89b85b959f5712ff58b184bfa2e064746d0b
Reviewed-on: https://code.wireshark.org/review/31026
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-ieee80211.c')
-rw-r--r-- | epan/dissectors/packet-ieee80211.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/epan/dissectors/packet-ieee80211.c b/epan/dissectors/packet-ieee80211.c index 09abc5713a..088d6c88f9 100644 --- a/epan/dissectors/packet-ieee80211.c +++ b/epan/dissectors/packet-ieee80211.c @@ -24344,7 +24344,7 @@ dissect_ieee80211_common(tvbuff_t *tvb, packet_info *pinfo, } } - if (enable_decryption && !pinfo->fd->flags.visited) { + if (enable_decryption && !pinfo->fd->flags.visited && (len == reported_len)) { /* The processing will take care of 4-way handshake sessions for WPA and WPA2 decryption */ next_tvb = try_decrypt(tvb, pinfo, hdr_len, reported_len, TRUE, &algorithm, &sec_header, &sec_trailer, &used_key); @@ -24376,7 +24376,7 @@ dissect_ieee80211_common(tvbuff_t *tvb, packet_info *pinfo, if (next_tvb) { /* Already decrypted when searching for keys above. No need to decrypt again */ - } else { + } else if (len == reported_len) { next_tvb = try_decrypt(tvb, pinfo, hdr_len, reported_len, FALSE, &algorithm, &sec_header, &sec_trailer, &used_key); } |