]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Make sure go_dev_addr is initialized
authorJouni Malinen <j@w1.fi>
Sun, 23 Feb 2025 09:53:36 +0000 (11:53 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 23 Feb 2025 09:53:36 +0000 (11:53 +0200)
wpas_p2p_persistent_group() does not set go_dev_addr if the group is no
persistent. Initialize go_dev_addr explicitly to all zeroes before that
call to make sure it cannot be uninitialized here.

Signed-off-by: Jouni Malinen <j@w1.fi>
wpa_supplicant/p2p_supplicant.c

index f43d0fe48d07dcc967910950a6559fff4fb3dbae..107e21695ced0acf83af99f4bdeda33d5dca8f6e 100644 (file)
@@ -1602,11 +1602,13 @@ static void wpas_group_formation_completed(struct wpa_supplicant *wpa_s,
                        persistent = ssid->p2p_persistent_group;
                        os_memcpy(go_dev_addr, wpa_s->global->p2p_dev_addr,
                                  ETH_ALEN);
-               } else
+               } else {
+                       os_memset(go_dev_addr, 0, ETH_ALEN);
                        persistent = wpas_p2p_persistent_group(wpa_s,
                                                               go_dev_addr,
                                                               ssid->ssid,
                                                               ssid->ssid_len);
+               }
        } else {
                client = wpa_s->p2p_group_interface ==
                        P2P_GROUP_INTERFACE_CLIENT;