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: b9e2826b9d ("P2P: Filter 6 GHz channels if peer doesn't support them")
Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2022-11-20 12:22:08 +02:00
parent 30403e9657
commit f723f7f8ad

View 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,