Fix VHT valid checks.

The valid array in a struct mcs_vht_valid is indexed by the bandwidth
and the NSS-1; use the NSS-1, not the NSS, as the index.

The maximum possible value of the NSS is MAX_VHT_NSS, so allow a value
of MAX_VHT_NSS.

Change-Id: I49585f217f3e70356c1dd1ba32b6c714ce202236
Reviewed-on: https://code.wireshark.org/review/16426
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2016-07-13 20:13:22 -07:00
parent 335b2c0233
commit 2c0d11716b
1 changed files with 2 additions and 2 deletions

View File

@ -633,8 +633,8 @@ dissect_wlan_radio_phdr (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree,
* If we can calculate the data rate for this user, do so.
*/
if (can_calculate_rate && info_ac->mcs[i] <= MAX_MCS_VHT_INDEX &&
info_ac->nss[i] < MAX_VHT_NSS &&
ieee80211_vhtvalid[info_ac->mcs[i]].valid[bandwidth][info_ac->nss[i]]) {
info_ac->nss[i] <= MAX_VHT_NSS &&
ieee80211_vhtvalid[info_ac->mcs[i]].valid[bandwidth][info_ac->nss[i]-1]) {
data_rate = ieee80211_vhtrate(info_ac->mcs[i], bandwidth, info_ac->short_gi) * info_ac->nss[i];
if (data_rate != 0.0f) {
proto_tree_add_float_format_value(user_tree, hf_wlan_radio_data_rate, tvb, 0, 0,