eiwd

no dbus iwd with iwctl functionality
git clone https://git.daat.foo/repos/eiwd.git
Log | Files | Refs | Submodules | README | LICENSE

commit 338577bb3aa99e62dfe694146eb986f2cc99d502
parent 83c032a58357f968382c942e676f463ceac5e37a
Author: James Prestwood <prestwoj@gmail.com>
Date:   Thu, 29 Feb 2024 10:12:13 -0800

ap: check that the last band_freq_attrs was set

Static analysis complains that 'last' could be NULL which is true.
This really could only happen if every frequency was disabled which
likely is impossible but in any case, check before dereferencing
the pointer.

Diffstat:
Msrc/ap.c | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/ap.c b/src/ap.c @@ -1247,8 +1247,10 @@ static size_t ap_build_country_ie(struct ap_state *ap, uint8_t *out_buf, } /* finish final group */ - *pos++ = nchans; - *pos++ = last->tx_power; + if (last) { + *pos++ = nchans; + *pos++ = last->tx_power; + } len = pos - out_buf - 2;