[PATCH] drivers:nl80211: Fix segfault when params->freq is NULL

Chaitanya TK chaitanya.mgit at gmail.com
Thu Jul 14 09:50:40 PDT 2016


From: Chaitanya T K <Chaitanya.Mgit at gmail.com>

When params->freq is NULL, it leads to a SEGFAULT.
Do no initialize bss->bandwidth if params->freq is NULL.

Signed-off-by: Chaitanya T K <Chaitanya.Mgit at gmail.com>
---
 src/drivers/driver_nl80211.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index b2b27a7..0a6a535 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -3695,7 +3695,7 @@ static int wpa_driver_nl80211_set_ap(void *priv,
 					   "nl80211: Frequency set succeeded for ht2040 coex");
 				bss->bandwidth = params->freq->bandwidth;
 			}
-		} else if (!beacon_set) {
+		} else if (!beacon_set && params->freq) {
 			/*
 			 * cfg80211 updates the driver on frequence change in AP
 			 * mode only at the point when beaconing is started, so
-- 
1.7.9.5




More information about the Hostap mailing list