]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
SQLite: Fix temporary eap_user data freeing on interface restart
authorJouni Malinen <j@w1.fi>
Sat, 6 Mar 2021 09:44:38 +0000 (11:44 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 6 Mar 2021 09:44:38 +0000 (11:44 +0200)
hapd->tmp_eap_user needs to be cleared on interface deinit to avoid
leaving stale pointers to freed memory.

Fixes: ee431d77a51b ("Add preliminary support for using SQLite for eap_user database")
Signed-off-by: Jouni Malinen <j@w1.fi>
src/ap/hostapd.c

index f06647c953d4b4bd48cb21b98fc6c0f85ff14ecd..8892a7a0c423aea979ee2456f9daadc054683933 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * hostapd / Initialization and configuration
- * Copyright (c) 2002-2019, Jouni Malinen <j@w1.fi>
+ * Copyright (c) 2002-2021, Jouni Malinen <j@w1.fi>
  *
  * This software may be distributed under the terms of the BSD license.
  * See README for more details.
@@ -430,6 +430,7 @@ void hostapd_free_hapd_data(struct hostapd_data *hapd)
                       hapd->tmp_eap_user.identity_len);
        bin_clear_free(hapd->tmp_eap_user.password,
                       hapd->tmp_eap_user.password_len);
+       os_memset(&hapd->tmp_eap_user, 0, sizeof(hapd->tmp_eap_user));
 #endif /* CONFIG_SQLITE */
 
 #ifdef CONFIG_MESH