diff options
author | Guy Harris <guy@alum.mit.edu> | 2016-02-08 18:22:42 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2016-02-09 02:23:22 +0000 |
commit | ce6ac9e822c8ef716287f79fd3694c6ae7ca84a0 (patch) | |
tree | e20152fccaea943006885304ba9ff913731f9499 /epan/dissectors/packet-ieee80211-radio.c | |
parent | 0af5ef3fce9f6eb72d4d45b4424a4f219f7cb976 (diff) |
And we need to check Nsts as well.
The check against 0 isn't really necessary, as stbc_streams >= 0 and
ieee80211_ht_streams[info_n->mcs_index] >= 1, but, what the heck.
Make stbc_streams unsigned, as the value assigned to it is unsigned.
Bug: 12085
Change-Id: I98e0edb718f62ee07bbe56b9d15859c68b7d2e43
Reviewed-on: https://code.wireshark.org/review/13844
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/dissectors/packet-ieee80211-radio.c')
-rw-r--r-- | epan/dissectors/packet-ieee80211-radio.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/epan/dissectors/packet-ieee80211-radio.c b/epan/dissectors/packet-ieee80211-radio.c index c447d5540c..90ddbd84c0 100644 --- a/epan/dissectors/packet-ieee80211-radio.c +++ b/epan/dissectors/packet-ieee80211-radio.c @@ -704,7 +704,7 @@ dissect_wlan_radio (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void static const guint Nhtdltf[4] = {1, 2, 4, 4}; static const guint Nhteltf[4] = {0, 1, 2, 4}; guint Nsts, bits, Mstbc, bits_per_symbol, symbols; - int stbc_streams; + guint stbc_streams; guint ness; gboolean fec; @@ -767,6 +767,10 @@ dissect_wlan_radio (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void /* calculate number of HT-LTF training symbols. * see ieee80211n-2009 20.3.9.4.6 table 20-11 */ Nsts = ieee80211_ht_streams[info_n->mcs_index] + stbc_streams; + if (Nsts == 0 || Nsts - 1 >= G_N_ELEMENTS(Nhtdltf)) { + /* Not usable */ + break; + } preamble += 4 * (Nhtdltf[Nsts-1] + Nhteltf[ness]); if (info_n->has_fec) { |