mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-25 01:19:23 +01:00
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.
This commit is contained in:
parent
83c032a583
commit
338577bb3a
6
src/ap.c
6
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 */
|
/* finish final group */
|
||||||
*pos++ = nchans;
|
if (last) {
|
||||||
*pos++ = last->tx_power;
|
*pos++ = nchans;
|
||||||
|
*pos++ = last->tx_power;
|
||||||
|
}
|
||||||
|
|
||||||
len = pos - out_buf - 2;
|
len = pos - out_buf - 2;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user