]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Set wpa_s->global for module tests
authorJouni Malinen <quic_jouni@quicinc.com>
Fri, 24 Nov 2023 18:59:37 +0000 (20:59 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 24 Nov 2023 19:02:03 +0000 (21:02 +0200)
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 <quic_jouni@quicinc.com>
wpa_supplicant/wpas_module_tests.c

index ce5398cb851a29e285d2fd35a306c0d43ca8663b..9e7a57c4f134cabe0e7b9a3320d74a651eeefc02 100644 (file)
 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);