]> git.ipfire.org Git - thirdparty/hostap.git/commit
hostapd: Fix static analyzer issue for CHAN_SWITCH 6 GHz bw
authorHu Wang <quic_huw@quicinc.com>
Tue, 25 Mar 2025 06:12:03 +0000 (23:12 -0700)
committerJouni Malinen <j@w1.fi>
Tue, 25 Mar 2025 20:57:26 +0000 (22:57 +0200)
commitea23746fd79a28a84e426161d4f17e2fb961aef8
tree66254fedc6685f28d3a10d0aeb5b78d547327064
parentb5e326d24298ac52fba3c4e5ba5ae79780c78dc9
hostapd: Fix static analyzer issue for CHAN_SWITCH 6 GHz bw

Static analyzer complains:
In hostapd_ctrl_check_freq_params(), Array 'bw_idx' of size 5
may use index value(s) 5.

The highest value that center_idx_to_bw_6ghz(idx) can currently return
is 4, so this is not really able to trigger read beyond the end of the
array. In any case, the bounds check is clearly incorrect and needs to
be fixed so that this is able to handle any potential future extension.

Fixes: 744295c8bc5a ("Add 6 GHz channel validation during channel switching")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
hostapd/ctrl_iface.c