提交 f0bce44f 编写于 作者: R roel 提交者: John W. Linville

ath9k: index out of bounds

Check whether index is within bounds before testing the element
Signed-off-by: NRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 0f8e94d2
...@@ -1092,8 +1092,7 @@ static int ath_rc_get_rateindex(const struct ath_rate_table *rate_table, ...@@ -1092,8 +1092,7 @@ static int ath_rc_get_rateindex(const struct ath_rate_table *rate_table,
if (!(rate->flags & IEEE80211_TX_RC_MCS)) if (!(rate->flags & IEEE80211_TX_RC_MCS))
return rate->idx; return rate->idx;
while (rate->idx > mcs_rix_off[i] && while (i < ARRAY_SIZE(mcs_rix_off) && rate->idx > mcs_rix_off[i]) {
i < ARRAY_SIZE(mcs_rix_off)) {
rix++; i++; rix++; i++;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册