]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
ERP: Initialize hapd->erp_keys earlier to avoid undefined behavior
authorJouni Malinen <quic_jouni@quicinc.com>
Tue, 25 Feb 2025 21:44:47 +0000 (23:44 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 25 Feb 2025 22:21:38 +0000 (00:21 +0200)
This dl_list needs to be initialized earlier since
ieee802_1x_erp_flush() is trying to clear it even in case of failed
interface start that might not have made it all the way to the place
which the dl_list was previously initialized.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
src/ap/hostapd.c
src/ap/ieee802_1x.c

index 2e23239e5773ff87c2a719e5a38945d507d69b37..5b7af044f9c2d8e7013c1d94f1d6dbe098816338 100644 (file)
@@ -2965,6 +2965,7 @@ hostapd_alloc_bss_data(struct hostapd_iface *hapd_iface,
 #ifdef CONFIG_SAE
        dl_list_init(&hapd->sae_commit_queue);
 #endif /* CONFIG_SAE */
+       dl_list_init(&hapd->erp_keys);
 
        return hapd;
 }
index 95ae24d80388ec4f0ff71d06772a4dd454171501..efdf607ee8df386ac497cc12e9b029b509ab9685 100644 (file)
@@ -2542,8 +2542,6 @@ int ieee802_1x_init(struct hostapd_data *hapd)
        }
 #endif /* CONFIG_IEEE80211BE */
 
-       dl_list_init(&hapd->erp_keys);
-
        os_memset(&conf, 0, sizeof(conf));
        conf.eap_cfg = hapd->eap_cfg;
        conf.ctx = hapd;