Browse Source

Fix wpa_supplicant AP mode with WPS not to crash

Commit 3379a3a795803335b3f464f34a15f06843369fb1 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).
Jouni Malinen 14 years ago
parent
commit
0314e26a61
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/ap/wps_hostapd.c

+ 2 - 0
src/ap/wps_hostapd.c

@@ -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;