Fix wpa_supplicant AP mode with WPS not to crash

Commit 3379a3a795 added a direct
iface->for_each_interface use without verification whether the
function is available. This works with hostapd, but not
wpa_supplicant (which crashes on segfault).
This commit is contained in:
Jouni Malinen 2010-10-06 16:46:43 +03:00 committed by Jouni Malinen
parent d9c8a7c44c
commit 0314e26a61
1 changed files with 2 additions and 0 deletions

View File

@ -540,6 +540,8 @@ static int count_interface_cb(struct hostapd_iface *iface, void *ctx)
static int interface_count(struct hostapd_iface *iface)
{
int count = 0;
if (iface->for_each_interface == NULL)
return 0;
iface->for_each_interface(iface->interfaces, count_interface_cb,
&count);
return count;