From: Jouni Malinen Date: Wed, 6 Oct 2010 13:46:43 +0000 (+0300) Subject: Fix wpa_supplicant AP mode with WPS not to crash X-Git-Url: http://www.project-moonshot.org/gitweb/?p=libeap.git;a=commitdiff_plain;h=0314e26a61bcc18702479119d7568dcda2666167 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). --- diff --git a/src/ap/wps_hostapd.c b/src/ap/wps_hostapd.c index 7963d60..0b9c2af 100644 --- a/src/ap/wps_hostapd.c +++ b/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;