From 535eb7dbd954cf8eae984d5b347568f966e5dde8 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 15 May 2015 09:11:28 +0200 Subject: [PATCH] param lib: Fix use of array size --- src/modules/systemlib/param/param.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/systemlib/param/param.c b/src/modules/systemlib/param/param.c index 14e7299e60..e86f09ffae 100644 --- a/src/modules/systemlib/param/param.c +++ b/src/modules/systemlib/param/param.c @@ -298,7 +298,7 @@ param_for_used_index(unsigned index) /* walk all params and count */ int count = 0; - for (unsigned i = 0; i < (unsigned)param_info_count + 1; i++) { + for (unsigned i = 0; i < (unsigned)size_param_changed_storage_bytes; i++) { for (unsigned j = 0; j < 8; j++) { if (param_changed_storage[i] & (1 << j)) {