From: Jouni Malinen Date: Fri, 24 Nov 2023 18:59:37 +0000 (+0200) Subject: tests: Set wpa_s->global for module tests X-Git-Tag: hostap_2_11~783 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c8b4ad70b17bbe59a5dd4aa8d222387424c1702a;p=thirdparty%2Fhostap.git tests: Set wpa_s->global for module tests This is needed to avoid NULL pointer deferencing in wpa_supplicant_ctrl_iface_msg_cb() if any of the functions called from wpas_bssid_ignore_module_tests_() ends up using wpa_msg(). Signed-off-by: Jouni Malinen --- diff --git a/wpa_supplicant/wpas_module_tests.c b/wpa_supplicant/wpas_module_tests.c index ce5398cb8..9e7a57c4f 100644 --- a/wpa_supplicant/wpas_module_tests.c +++ b/wpa_supplicant/wpas_module_tests.c @@ -17,9 +17,12 @@ static int wpas_bssid_ignore_module_tests(void) { struct wpa_supplicant wpa_s; + struct wpa_global global; int ret = -1; os_memset(&wpa_s, 0, sizeof(wpa_s)); + os_memset(&global, 0, sizeof(global)); + wpa_s.global = &global; wpa_bssid_ignore_clear(&wpa_s);