Initialize iface->sta_seen on allocation
authorJouni Malinen <jouni@qca.qualcomm.com>
Wed, 21 Sep 2016 21:31:00 +0000 (00:31 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 21 Sep 2016 21:45:24 +0000 (00:45 +0300)
commit5e993390f6ce34b169bf37becb2e5561262ec68f
tree45ccc2df089431bc60d410bcc5bf3e36a8bbd840
parent4424aa5d7d1a1624b2a2e0241430da7ee3e80a54
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>
src/ap/hostapd.c
src/ap/hostapd.h
wpa_supplicant/ap.c