From: Ben Wang Date: Wed, 19 Aug 2020 12:21:03 +0000 (+0800) Subject: EDMG: Validate pri channel lookup result before using it X-Git-Tag: hostap_2_10~178 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=61c0757618deee7e67d2b64a6e79b982652d1d50;p=thirdparty%2Fhostap.git 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 --- diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c index bb5404fa7..4b66b02f4 100644 --- a/src/ap/hw_features.c +++ b/src/ap/hw_features.c @@ -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,