From 61c0757618deee7e67d2b64a6e79b982652d1d50 Mon Sep 17 00:00:00 2001 From: Ben Wang Date: Wed, 19 Aug 2020 20:21:03 +0800 Subject: [PATCH] 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 --- src/ap/hw_features.c | 2 ++ 1 file changed, 2 insertions(+) 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,