Skip to content

Commit 6f9dbbd

Browse files
kapbhkartben
authored andcommitted
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]>
1 parent 0a0e041 commit 6f9dbbd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

subsys/net/l2/wifi/wifi_utils.c

Lines changed: 4 additions & 0 deletions
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)