]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Fix hostapd SIGHUP processing before interface is enabled
authorJouni Malinen <j@w1.fi>
Mon, 26 Dec 2016 22:55:32 +0000 (00:55 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 27 Dec 2016 09:16:51 +0000 (11:16 +0200)
It was possible to try to do driver operations before the driver
interface had been initialized when processing a SIGHUP signal. This
would result in NULL pointer dereference. Fix this by skipping the steps
when SIGHUP is issued before the interface is enabled.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/ap/hostapd.c

index 29c17bf95a7b5a9ba8fd76e7346442ad34c81e5f..9f972ae2447402b8c8d450c7a07a6ec5090f6026 100644 (file)
@@ -75,6 +75,9 @@ static void hostapd_reload_bss(struct hostapd_data *hapd)
 {
        struct hostapd_ssid *ssid;
 
+       if (!hapd->started)
+               return;
+
 #ifndef CONFIG_NO_RADIUS
        radius_client_reconfig(hapd->radius, hapd->conf->radius);
 #endif /* CONFIG_NO_RADIUS */
@@ -210,7 +213,7 @@ static void hostapd_broadcast_key_clear_iface(struct hostapd_data *hapd,
 {
        int i;
 
-       if (!ifname)
+       if (!ifname || !hapd->drv_priv)
                return;
        for (i = 0; i < NUM_WEP_KEYS; i++) {
                if (hostapd_drv_set_key(ifname, hapd, WPA_ALG_NONE, NULL, i,