EDMG: Validate pri channel lookup result before using it

At least in theory, hw_get_channel_freq() could return NULL, so add
error handling for that.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
Ben Wang 2020-08-19 20:21:03 +08:00 committed by Jouni Malinen
parent a95144cf34
commit 61c0757618

View file

@ -838,6 +838,8 @@ static int hostapd_is_usable_edmg(struct hostapd_iface *iface)
iface->freq, NULL,
iface->hw_features,
iface->num_hw_features);
if (!pri_chan)
return 0;
hostapd_encode_edmg_chan(iface->conf->enable_edmg,
iface->conf->edmg_channel,
pri_chan->chan,