From 8dd2c5bbf7c1042f9d8ee5a992f0dc47b853cc8b Mon Sep 17 00:00:00 2001 From: fpenard <89727717+fpenard@users.noreply.github.com> Date: Wed, 9 Jul 2025 23:55:22 +0200 Subject: [PATCH] fix(frftl): array out of bounds issue (#6427) --- radio/src/drivers/frftl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/radio/src/drivers/frftl.cpp b/radio/src/drivers/frftl.cpp index 02ef61ec6..e6d27d497 100644 --- a/radio/src/drivers/frftl.cpp +++ b/radio/src/drivers/frftl.cpp @@ -1150,8 +1150,8 @@ bool ftlInit(FrFTL* ftl, const FrFTLOps* cb, uint16_t flashSizeInMB) { // Check flash size bool found = false; - for (uint8_t i = 0; i < sizeof(supportedFlashSizes); i++) { - if (flashSizeInMB == supportedFlashSizes[i]) { + for (const auto& size : supportedFlashSizes) { + if (flashSizeInMB == size) { found = true; break; }