3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-22 06:29:23 +01:00

unit: memset band to zero after alloc

In test-band the band object was allocated using l_malloc, but not
memset to zero. This will cause problems if allocated pointers are
included in struct band once band is freed.
This commit is contained in:
James Prestwood 2022-07-19 15:29:49 -07:00 committed by Denis Kenzior
parent 6c6bfb3d16
commit 7f63872dcf

View File

@ -52,6 +52,8 @@ static struct band *new_band()
/* band + 8 basic rates */ /* band + 8 basic rates */
struct band *band = l_malloc(sizeof(struct band) + 8); struct band *band = l_malloc(sizeof(struct band) + 8);
memset(band, 0, sizeof(struct band) + 8);
band->supported_rates_len = 8; band->supported_rates_len = 8;
band->supported_rates[0] = 12; band->supported_rates[0] = 12;
band->supported_rates[1] = 18; band->supported_rates[1] = 18;