aboutsummaryrefslogtreecommitdiffstats
path: root/src/ap/wpa_auth_glue.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2015-10-13 20:35:00 (GMT)
committerJouni Malinen <j@w1.fi>2015-10-14 15:42:07 (GMT)
commit1b822f52e6356e78938f285d511d458e202fbc76 (patch)
tree452d742568a93d3b2eebe62490f0eb7a22c23637 /src/ap/wpa_auth_glue.c
parent4150c7c97c3de10ced627eb26edfb45970795f82 (diff)
downloadhostap-1b822f52e6356e78938f285d511d458e202fbc76.zip
hostap-1b822f52e6356e78938f285d511d458e202fbc76.tar.gz
hostap-1b822f52e6356e78938f285d511d458e202fbc76.tar.bz2
hostapd: Fix WPA, IEEE 802.1X, and WPS deinit in cases where init fails
With driver wrappers that implement set_privacy(), set_generic_elem(), set_ieee8021x(), or set_ap_wps_ie(), it was possible to hit a NULL pointer dereference in error cases where interface setup failed and the network configuration used WPA/WPA2, IEEE 802.1X, or WPS. Fix this by skipping the driver operations in case the driver interface is not initialized. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'src/ap/wpa_auth_glue.c')
-rw-r--r--src/ap/wpa_auth_glue.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ap/wpa_auth_glue.c b/src/ap/wpa_auth_glue.c
index f98cc50..ffd0790 100644
--- a/src/ap/wpa_auth_glue.c
+++ b/src/ap/wpa_auth_glue.c
@@ -674,13 +674,14 @@ void hostapd_deinit_wpa(struct hostapd_data *hapd)
wpa_deinit(hapd->wpa_auth);
hapd->wpa_auth = NULL;
- if (hostapd_set_privacy(hapd, 0)) {
+ if (hapd->drv_priv && hostapd_set_privacy(hapd, 0)) {
wpa_printf(MSG_DEBUG, "Could not disable "
"PrivacyInvoked for interface %s",
hapd->conf->iface);
}
- if (hostapd_set_generic_elem(hapd, (u8 *) "", 0)) {
+ if (hapd->drv_priv &&
+ hostapd_set_generic_elem(hapd, (u8 *) "", 0)) {
wpa_printf(MSG_DEBUG, "Could not remove generic "
"information element from interface %s",
hapd->conf->iface);