Fix sched_scan filter setting for max_match_sets == 0
The previous implementation was trying to add the first SSID to a zero-length array. Avoid this with an explicit validation of the array length. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
parent
fb67eec6f8
commit
fcd1684787
1 changed files with 2 additions and 1 deletions
|
@ -755,7 +755,8 @@ int wpa_supplicant_req_sched_scan(struct wpa_supplicant *wpa_s)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (params.filter_ssids && ssid->ssid && ssid->ssid_len) {
|
if (params.num_filter_ssids < wpa_s->max_match_sets &&
|
||||||
|
params.filter_ssids && ssid->ssid && ssid->ssid_len) {
|
||||||
wpa_dbg(wpa_s, MSG_DEBUG, "add to filter ssid: %s",
|
wpa_dbg(wpa_s, MSG_DEBUG, "add to filter ssid: %s",
|
||||||
wpa_ssid_txt(ssid->ssid, ssid->ssid_len));
|
wpa_ssid_txt(ssid->ssid, ssid->ssid_len));
|
||||||
os_memcpy(params.filter_ssids[params.num_filter_ssids].ssid,
|
os_memcpy(params.filter_ssids[params.num_filter_ssids].ssid,
|
||||||
|
|
Loading…
Reference in a new issue