[PATCH] hostap: clean beacon_data before usage

Janusz Dziedzic janusz.dziedzic
Fri Nov 22 12:21:25 PST 2013


struct beacon_data contains a lot of pointers.
We should clean them before usage. In other case
we could have garbage there and next segfaults.

Eg.
nl80211_switch_channel() ../src/drivers/driver_nl80211.c:11323
or os_free() issues.

Signed-hostap: Janusz Dziedzic <janusz.dziedzic at tieto.com>
---
Found during DFS and CSA testing.

 src/ap/hostapd.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
index 69e8956..efaae85 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -2049,6 +2049,7 @@ static int hostapd_build_beacon_data(struct hostapd_iface *iface,
 	int ret;
 	struct hostapd_data *hapd = iface->bss[0];
 
+	os_memset(beacon, 0, sizeof(*beacon));
 	ret = ieee802_11_build_ap_params(hapd, &params);
 	if (ret < 0)
 		return ret;
-- 
1.7.9.5




More information about the Hostap mailing list