aboutsummaryrefslogtreecommitdiffstats
path: root/src/ap/ap_drv_ops.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2014-11-16 23:08:04 (GMT)
committerJouni Malinen <j@w1.fi>2014-11-16 23:08:04 (GMT)
commite9b783d58c23a7bb50b2f25bce7157f1f3b5d58b (patch)
treeff539334d15ab5f72d9ecb2606861cd0900e01d4 /src/ap/ap_drv_ops.c
parent01b24c52df57d1714b2520fb9fef21cdb3e1db61 (diff)
downloadhostap-e9b783d58c23a7bb50b2f25bce7157f1f3b5d58b.zip
hostap-e9b783d58c23a7bb50b2f25bce7157f1f3b5d58b.tar.gz
hostap-e9b783d58c23a7bb50b2f25bce7157f1f3b5d58b.tar.bz2
Fix hostapd operation without hw_mode driver data
Commit 7f0303d5b0bb425f3e7318a7016b55ba9e67f9de ('hostapd: Verify VHT 160/80+80 MHz driver support') added couple of hapd->iface->current_mode dereferences of which the one in hostapd_set_freq() can be hit with some configuration files when using driver wrappers that do not have hw_mode data, i.e., when current_mode is NULL. This could result in segmentation fault when trying to use driver=wired. Fix this by checking that current_mode is not NULL before dereferencing it to get vht_capab. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/ap/ap_drv_ops.c')
-rw-r--r--src/ap/ap_drv_ops.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
index cc4ac10..262fdcd 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
@@ -573,7 +573,8 @@ int hostapd_set_freq(struct hostapd_data *hapd, int mode, int freq,
vht_enabled, sec_channel_offset,
vht_oper_chwidth,
center_segment0, center_segment1,
- hapd->iface->current_mode->vht_capab))
+ hapd->iface->current_mode ?
+ hapd->iface->current_mode->vht_capab : 0))
return -1;
if (hapd->driver == NULL)