aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2016-09-21 21:31:00 (GMT)
committerJouni Malinen <j@w1.fi>2016-09-21 21:45:24 (GMT)
commit5e993390f6ce34b169bf37becb2e5561262ec68f (patch)
tree45ccc2df089431bc60d410bcc5bf3e36a8bbd840 /wpa_supplicant
parent4424aa5d7d1a1624b2a2e0241430da7ee3e80a54 (diff)
downloadhostap-5e993390f6ce34b169bf37becb2e5561262ec68f.zip
hostap-5e993390f6ce34b169bf37becb2e5561262ec68f.tar.gz
hostap-5e993390f6ce34b169bf37becb2e5561262ec68f.tar.bz2
Initialize iface->sta_seen on allocation
Previously, struct hostapd_iface sta_seen list head was initialized only when completing interface setup. This left a window for operation that could potentially iterate through the list before the list head has been initialized. While the existing code checked iface->num_sta_seen to avoid this case, it is much cleaner to initialize the list when struct hostapd_iface is allocated to avoid any accidental missing of the extra checks before list iteration. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/ap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c
index 356784a..5afb772 100644
--- a/wpa_supplicant/ap.c
+++ b/wpa_supplicant/ap.c
@@ -675,7 +675,7 @@ int wpa_supplicant_create_ap(struct wpa_supplicant *wpa_s,
return -1;
}
- wpa_s->ap_iface = hapd_iface = os_zalloc(sizeof(*wpa_s->ap_iface));
+ wpa_s->ap_iface = hapd_iface = hostapd_alloc_iface();
if (hapd_iface == NULL)
return -1;
hapd_iface->owner = wpa_s;