Fix Beacon RX before AP setup completion
authorJouni Malinen <j@w1.fi>
Thu, 6 Feb 2014 13:22:06 +0000 (15:22 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 6 Feb 2014 13:22:06 +0000 (15:22 +0200)
It is possible for the driver to report Beacon RX prior to hostapd
having completed AP mode setup, e.g., when changing country code. Beacon
frame processing for OLBC was not prepared for this and could trigger
segfault due to NULL pointer dereference. Fix this by ignoring the
Beacon frames received prior to completing interface setup when
determining OLBC updates.

Signed-hostap: Jouni Malinen <j@w1.fi>

src/ap/ap_list.c

index f9b1540..287d520 100644 (file)
@@ -32,7 +32,8 @@ static int ap_list_beacon_olbc(struct hostapd_iface *iface, struct ap_info *ap)
 {
        int i;
 
-       if (iface->current_mode->mode != HOSTAPD_MODE_IEEE80211G ||
+       if (iface->current_mode == NULL ||
+           iface->current_mode->mode != HOSTAPD_MODE_IEEE80211G ||
            iface->conf->channel != ap->channel)
                return 0;