From 573583e3a8ac221ae80740f72bd8eab60b9ef92b Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 16 Jul 2024 10:52:49 +1000 Subject: [PATCH] test/registry: fix array overrun test/registry.c:532:9: overrun-local: Overrunning array "tl->iso639" of 3 8-byte elements at element index 23 (byte offset 191) using index "i" (which evaluates to 23). --- test/registry.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/registry.c b/test/registry.c index 75efa834..6ce56de1 100644 --- a/test/registry.c +++ b/test/registry.c @@ -513,7 +513,7 @@ cmp_layouts(struct test_layout *tl, struct rxkb_layout *l) return false; iso3166 = rxkb_layout_get_iso3166_first(l); - for (size_t i = 0; i < sizeof(tl->iso3166); i++) { + for (size_t i = 0; i < ARRAY_SIZE(tl->iso3166); i++) { const char *iso = tl->iso3166[i]; if (iso == NULL && iso3166 == NULL) break; @@ -528,7 +528,7 @@ cmp_layouts(struct test_layout *tl, struct rxkb_layout *l) return false; iso639 = rxkb_layout_get_iso639_first(l); - for (size_t i = 0; i < sizeof(tl->iso639); i++) { + for (size_t i = 0; i < ARRAY_SIZE(tl->iso639); i++) { const char *iso = tl->iso639[i]; if (iso == NULL && iso639 == NULL) break;