]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Fix use after free with hapd->time_adv on interface restart
authorMichael Braun <michael-dev@fami-braun.de>
Mon, 1 Mar 2021 21:27:46 +0000 (23:27 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 6 Mar 2021 09:37:26 +0000 (11:37 +0200)
When an interface is disabled, e.g. due to radar detected,
hapd->time_adv is freed by hostapd_free_hapd_data(), but later
used by ieee802_11_build_ap_params() calling hostapd_eid_time_adv().

Thus hapd->time_adv needs to be cleared as well.

Fixes: 39b97072b2a4 ("Add support for Time Advertisement")
Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
src/ap/hostapd.c

index 2f3e7878f6fcddfcd92383c616ab0bd6d219d801..f06647c953d4b4bd48cb21b98fc6c0f85ff14ecd 100644 (file)
@@ -414,6 +414,7 @@ void hostapd_free_hapd_data(struct hostapd_data *hapd)
        }
 
        wpabuf_free(hapd->time_adv);
+       hapd->time_adv = NULL;
 
 #ifdef CONFIG_INTERWORKING
        gas_serv_deinit(hapd);