From 74bdc97b345f8df8cc8c19e969bb50b741cebae1 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Wed, 2 Jan 2019 10:30:41 +0100 Subject: [PATCH] ublox: use fixed array sizes when iterating --- plugins/ublox/mm-modem-helpers-ublox.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/ublox/mm-modem-helpers-ublox.c b/plugins/ublox/mm-modem-helpers-ublox.c index 0da30993..ef84dc9f 100644 --- a/plugins/ublox/mm-modem-helpers-ublox.c +++ b/plugins/ublox/mm-modem-helpers-ublox.c @@ -1210,7 +1210,7 @@ append_bands (GArray *bands, if (mode & MM_MODEM_MODE_4G) { for (j = 0; j < G_N_ELEMENTS (num_bands_4g); j++) { if (ubandsel_value == num_bands_4g[j].num) { - for (k = 0; k < 5; k++) { + for (k = 0; k < G_N_ELEMENTS (num_bands_4g[j].band); k++) { band = num_bands_4g[j].band[k]; for (x = 0; x < G_N_ELEMENTS (band_configuration[i].bands_4g); x++) { if (band_configuration[i].bands_4g[x] == band) {