Skip to content

Commit 34633fc

Browse files
kapbhnordicjm
authored andcommitted
[nrf fromtree] wifi: utils: Fix crash for scan
The check for index out of bound is missing, It turns into a crash for input channel more than WIFI_MGMT_SCAN_CHAN_MAX_MANUAL. Signed-off-by: Kapil Bhatt <[email protected]> (cherry picked from commit 6f9dbbd)
1 parent 99bbeff commit 34633fc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

subsys/net/l2/wifi/wifi_utils.c

+4
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,10 @@ static int wifi_utils_get_all_chans_in_range(uint8_t chan_start,
175175
}
176176

177177
if (start) {
178+
if (idx > WIFI_MGMT_SCAN_CHAN_MAX_MANUAL) {
179+
*chan_idx = idx;
180+
break;
181+
}
178182
band_chan[idx].band = band_idx;
179183
band_chan[idx].channel = valid_5g_chans_20mhz[i];
180184
idx++;

0 commit comments

Comments
 (0)