commit 7f63872dcfd0d1a3c3b678f4db2b0ac4bdd25888
parent 6c6bfb3d1650e8b77125760bb2997d315972eaa7
Author: James Prestwood <prestwoj@gmail.com>
Date: Tue, 19 Jul 2022 15:29:49 -0700
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.
Diffstat:
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/unit/test-band.c b/unit/test-band.c
@@ -52,6 +52,8 @@ static struct band *new_band()
/* band + 8 basic rates */
struct band *band = l_malloc(sizeof(struct band) + 8);
+ memset(band, 0, sizeof(struct band) + 8);
+
band->supported_rates_len = 8;
band->supported_rates[0] = 12;
band->supported_rates[1] = 18;