aboutsummaryrefslogtreecommitdiffstats
path: root/src/ap/ap_drv_ops.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2016-08-19 09:24:15 (GMT)
committerJouni Malinen <j@w1.fi>2016-08-19 13:08:00 (GMT)
commit1f3b8b4edbccfdd60cc28d0f11080eb7181c28b9 (patch)
treed731bf8f9943d6329feff3050418fd0b9fab47ad /src/ap/ap_drv_ops.c
parent833d0d45e8bc625fae856ccfa895f8ed01fcd2cd (diff)
downloadhostap-1f3b8b4edbccfdd60cc28d0f11080eb7181c28b9.zip
hostap-1f3b8b4edbccfdd60cc28d0f11080eb7181c28b9.tar.gz
hostap-1f3b8b4edbccfdd60cc28d0f11080eb7181c28b9.tar.bz2
Check for driver initialization before doing driver operations
Number of hostapd control interface commands (e.g., STATUS-DRIVER) could result in NULL pointer dereference when issued on not yet enabled BSS. Fix this by checking that the driver interface has been initialized before calling the driver_ops function. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'src/ap/ap_drv_ops.c')
-rw-r--r--src/ap/ap_drv_ops.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
index 532b72f..f139465 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
@@ -623,7 +623,7 @@ int hostapd_drv_set_key(const char *ifname, struct hostapd_data *hapd,
int hostapd_drv_send_mlme(struct hostapd_data *hapd,
const void *msg, size_t len, int noack)
{
- if (hapd->driver == NULL || hapd->driver->send_mlme == NULL)
+ if (!hapd->driver || !hapd->driver->send_mlme || !hapd->drv_priv)
return 0;
return hapd->driver->send_mlme(hapd->drv_priv, msg, len, noack, 0,
NULL, 0);
@@ -644,7 +644,7 @@ int hostapd_drv_send_mlme_csa(struct hostapd_data *hapd,
int hostapd_drv_sta_deauth(struct hostapd_data *hapd,
const u8 *addr, int reason)
{
- if (hapd->driver == NULL || hapd->driver->sta_deauth == NULL)
+ if (!hapd->driver || !hapd->driver->sta_deauth || !hapd->drv_priv)
return 0;
return hapd->driver->sta_deauth(hapd->drv_priv, hapd->own_addr, addr,
reason);
@@ -654,7 +654,7 @@ int hostapd_drv_sta_deauth(struct hostapd_data *hapd,
int hostapd_drv_sta_disassoc(struct hostapd_data *hapd,
const u8 *addr, int reason)
{
- if (hapd->driver == NULL || hapd->driver->sta_disassoc == NULL)
+ if (!hapd->driver || !hapd->driver->sta_disassoc || !hapd->drv_priv)
return 0;
return hapd->driver->sta_disassoc(hapd->drv_priv, hapd->own_addr, addr,
reason);
@@ -680,7 +680,7 @@ int hostapd_drv_send_action(struct hostapd_data *hapd, unsigned int freq,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};
- if (hapd->driver == NULL || hapd->driver->send_action == NULL)
+ if (!hapd->driver || !hapd->driver->send_action || !hapd->drv_priv)
return 0;
bssid = hapd->own_addr;
if (!is_multicast_ether_addr(dst) &&
@@ -754,7 +754,7 @@ int hostapd_start_dfs_cac(struct hostapd_iface *iface,
int hostapd_drv_set_qos_map(struct hostapd_data *hapd,
const u8 *qos_map_set, u8 qos_map_set_len)
{
- if (hapd->driver == NULL || hapd->driver->set_qos_map == NULL)
+ if (!hapd->driver || !hapd->driver->set_qos_map || !hapd->drv_priv)
return 0;
return hapd->driver->set_qos_map(hapd->drv_priv, qos_map_set,
qos_map_set_len);