]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Initialize new_ssid explicitly to make this easier for analyzers
authorJouni Malinen <j@w1.fi>
Sun, 23 Feb 2025 09:56:16 +0000 (11:56 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 23 Feb 2025 09:56:16 +0000 (11:56 +0200)
new_ssid_len == 0 was used to skip reference to new_ssid in
p2p_build_invitation_resp(). This was too complex for some static
analyzers to notice, so initialize new_ssid as well to avoid false
reports.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/p2p/p2p_invitation.c

index 26f7cae9b333274e1c0a2ee32aa73d95628126cc..6d112ee87b290217a2ae3a1a502c7cb7e32839b6 100644 (file)
@@ -210,7 +210,7 @@ struct wpabuf * p2p_process_invitation_req(struct p2p_data *p2p, const u8 *sa,
        u8 group_bssid[ETH_ALEN], *bssid;
        int op_freq = 0;
        u8 reg_class = 0, channel = 0;
-       const u8 *new_ssid;
+       const u8 *new_ssid = NULL;
        size_t new_ssid_len = 0;
        struct p2p_channels all_channels, intersection, *channels = NULL;
        int persistent;