diff --git a/hostapd/config_file.c b/hostapd/config_file.c index 9c744de5c..8e7bcc7e7 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c @@ -208,7 +208,8 @@ static int hostapd_config_read_maclist(const char *fname, fclose(f); - qsort(*acl, *num, sizeof(**acl), hostapd_acl_comp); + if (*acl) + qsort(*acl, *num, sizeof(**acl), hostapd_acl_comp); return 0; } diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c index fb8ebdf2e..bfde0af1f 100644 --- a/wpa_supplicant/scan.c +++ b/wpa_supplicant/scan.c @@ -2177,8 +2177,10 @@ wpa_supplicant_get_scan_results(struct wpa_supplicant *wpa_s, } #endif /* CONFIG_WPS */ - qsort(scan_res->res, scan_res->num, sizeof(struct wpa_scan_res *), - compar); + if (scan_res->res) { + qsort(scan_res->res, scan_res->num, + sizeof(struct wpa_scan_res *), compar); + } dump_scan_res(scan_res); wpa_bss_update_start(wpa_s);