Fix wpa_auth_iface_iter() to skip BSSes without Authenticator

This could cause NULL pointer deference if multi-BSS configuration
was used with OKC in some cases.
This commit is contained in:
Jouni Malinen 2010-03-26 23:26:24 -07:00
parent b766a9a293
commit 03bcb0af0d

View file

@ -270,7 +270,8 @@ static int wpa_auth_iface_iter(struct hostapd_iface *iface, void *ctx)
struct wpa_auth_iface_iter_data *data = ctx;
size_t i;
for (i = 0; i < iface->num_bss; i++) {
if (data->cb(iface->bss[i]->wpa_auth, data->cb_ctx))
if (iface->bss[i]->wpa_auth &&
data->cb(iface->bss[i]->wpa_auth, data->cb_ctx))
return 1;
}
return 0;