]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Check dev pointer consistently when building PD Response
authorJouni Malinen <j@w1.fi>
Sun, 20 Nov 2022 10:22:08 +0000 (12:22 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 20 Nov 2022 13:15:58 +0000 (15:15 +0200)
The dev pointer could potentially be NULL here in some P2PS cases, so
check it explicitly before dereferencing it when checking for 6 GHz
capability.

Fixes: b9e2826b9d76 ("P2P: Filter 6 GHz channels if peer doesn't support them")
Signed-off-by: Jouni Malinen <j@w1.fi>
src/p2p/p2p_pd.c

index c4960fae2d56f704ea20016bc83de83743c86622..f75cee8ae0085a9e3bf1cf92a3afd3f7faeaf2a2 100644 (file)
@@ -365,7 +365,7 @@ static struct wpabuf * p2p_build_prov_disc_resp(struct p2p_data *p2p,
                    (conncap & (P2PS_SETUP_CLIENT | P2PS_SETUP_GROUP_OWNER))) {
                        bool is_6ghz_capab;
 
-                       is_6ghz_capab = is_p2p_6ghz_capable(p2p) &&
+                       is_6ghz_capab = is_p2p_6ghz_capable(p2p) && dev &&
                                p2p_is_peer_6ghz_capab(
                                        p2p, dev->info.p2p_device_addr);
                        p2p_buf_add_channel_list(buf, p2p->cfg->country,