]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Check network configuration availability before use in MAC randomization
authorJouni Malinen <j@w1.fi>
Sun, 23 Feb 2025 09:36:03 +0000 (11:36 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 23 Feb 2025 09:36:03 +0000 (11:36 +0200)
wpas_update_random_addr_disassoc() could call wpas_update_random_addr()
with ssid == NULL, so need to be more careful here when comparing the
pregenerated address.

Fixes: bdbb6e0035ae ("wpa_supplicant: Handle MAC address randomization changes for same ESS")
Signed-off-by: Jouni Malinen <j@w1.fi>
wpa_supplicant/wpa_supplicant.c

index 31e6bf97a26c533cdca036a5a78f074f49d0baa6..e54ad8bea088a92c549b4f79b9f62aa813fb911f 100644 (file)
@@ -2557,7 +2557,8 @@ int wpas_update_random_addr(struct wpa_supplicant *wpa_s,
                if (style == WPAS_MAC_ADDR_STYLE_DEDICATED_PER_ESS) {
                        /* Pregenerated addresses do not expire but their value
                         * might have changed, so let's check that. */
-                       if (ether_addr_equal(wpa_s->own_addr, ssid->mac_value))
+                       if (ssid &&
+                           ether_addr_equal(wpa_s->own_addr, ssid->mac_value))
                                return 0;
                } else if ((wpa_s->last_mac_addr_change.sec != 0 ||
                            wpa_s->last_mac_addr_change.usec != 0) &&