]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
EDMG: Validate pri channel lookup result before using it
authorBen Wang <benw@codeaurora.org>
Wed, 19 Aug 2020 12:21:03 +0000 (20:21 +0800)
committerJouni Malinen <j@w1.fi>
Thu, 2 Sep 2021 15:45:09 +0000 (18:45 +0300)
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>
src/ap/hw_features.c

index bb5404fa7dd4df6664d94a69e7f5f24d59f3aa84..4b66b02f4e16073196a78e924adefef962bebd88 100644 (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,