p2p_supplicant: ensure go_dev_addr is init'ed
The static analyzer complains that this function may occasionally exit
while leaving go_dev_addr uninitialized. Since we use it even if this
function exits 'unsuccessfully', we should ensure this has consistent
bits.
Bug: 206470603
Test: TH
Change-Id: I320218643c603549840d805c47c109b503e9127d
diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index a7e7587..ff0871b 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -1402,11 +1402,13 @@
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;