Skip to content

Commit 5f0fabf

Browse files
bingzlinvjw
authored andcommitted
mwifiex: fix potential out-of-boundary access to ibss rate table
smatch found this error: CHECK drivers/net/wireless/mwifiex/join.c drivers/net/wireless/mwifiex/join.c:1121 mwifiex_cmd_802_11_ad_hoc_join() error: testing array offset 'i' after use. Cc: <[email protected]> # 3.0+ Signed-off-by: Bing Zhao <[email protected]> Signed-off-by: John W. Linville <[email protected]>
1 parent 930df2d commit 5f0fabf

File tree

1 file changed

+3
-4
lines changed
  • drivers/net/wireless/mwifiex

1 file changed

+3
-4
lines changed

drivers/net/wireless/mwifiex/join.c

+3-4
Original file line numberDiff line numberDiff line change
@@ -1117,10 +1117,9 @@ mwifiex_cmd_802_11_ad_hoc_join(struct mwifiex_private *priv,
11171117
adhoc_join->bss_descriptor.bssid,
11181118
adhoc_join->bss_descriptor.ssid);
11191119

1120-
for (i = 0; bss_desc->supported_rates[i] &&
1121-
i < MWIFIEX_SUPPORTED_RATES;
1122-
i++)
1123-
;
1120+
for (i = 0; i < MWIFIEX_SUPPORTED_RATES &&
1121+
bss_desc->supported_rates[i]; i++)
1122+
;
11241123
rates_size = i;
11251124

11261125
/* Copy Data Rates from the Rates recorded in scan response */

0 commit comments

Comments
 (0)