]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Fix segfault in hostapd_eid_ht_capabilities() with some drivers
authorJouni Malinen <j@w1.fi>
Sun, 5 Sep 2010 09:47:16 +0000 (12:47 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 5 Sep 2010 09:47:16 +0000 (12:47 +0300)
This function is not really needed in case of drivers that build the
HT IEs internally. However, since this can get called if ieee80211n=1
is set in hostapd.conf, we better not segfault even if the driver
does not provide hw info (hapd->iface->current_mode == NULL).

src/ap/ieee802_11_ht.c

index b193ee08cecdee26f3f957bb85b392a72b8a4af0..7541b83816d029d3e5ef56ad424c55d7f48bd216 100644 (file)
@@ -30,7 +30,7 @@ u8 * hostapd_eid_ht_capabilities(struct hostapd_data *hapd, u8 *eid)
        struct ieee80211_ht_capabilities *cap;
        u8 *pos = eid;
 
-       if (!hapd->iconf->ieee80211n)
+       if (!hapd->iconf->ieee80211n || !hapd->iface->current_mode)
                return eid;
 
        *pos++ = WLAN_EID_HT_CAP;