aboutsummaryrefslogtreecommitdiffstats
path: root/src/ap
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2016-12-26 22:55:32 (GMT)
committerJouni Malinen <j@w1.fi>2016-12-27 09:16:51 (GMT)
commit1dfd25a68afeae665ddff7faa13365a5c5c08bf1 (patch)
tree612267fe6e446ef93a28158701c2d05c467021dd /src/ap
parent8f49787897682a58cedebf830969a2f5ba372b90 (diff)
downloadhostap-1dfd25a68afeae665ddff7faa13365a5c5c08bf1.zip
hostap-1dfd25a68afeae665ddff7faa13365a5c5c08bf1.tar.gz
hostap-1dfd25a68afeae665ddff7faa13365a5c5c08bf1.tar.bz2
Fix hostapd SIGHUP processing before interface is enabled
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>
Diffstat (limited to 'src/ap')
-rw-r--r--src/ap/hostapd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
index 29c17bf..9f972ae 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -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,