From f723f7f8adb8be3b183f7e424f155f3ad1b7127d Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 20 Nov 2022 12:22:08 +0200 Subject: [PATCH] P2P: Check dev pointer consistently when building PD Response 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 --- src/p2p/p2p_pd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p2p/p2p_pd.c b/src/p2p/p2p_pd.c index c4960fae2..f75cee8ae 100644 --- a/src/p2p/p2p_pd.c +++ b/src/p2p/p2p_pd.c @@ -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, -- 2.47.2