summaryrefslogtreecommitdiff
path: root/Assemble.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-06-17 14:48:33 +1000
committerNeilBrown <neilb@suse.de>2011-06-17 14:48:33 +1000
commitb787bec6bd0ef74a65cc4fab28496996e4a3c12b (patch)
treeb32beda30b21d2de0d21915f64255e17dc1d728a /Assemble.c
parent73e658d8ccf2ac73d795866e1b568f04cf8ee565 (diff)
Don't index past the end of 'best' array in Assemble.
The 'best' array only has 'bestcnt' entries allocated, so 'i' should always be "< bestcnt", not "<= bestcnt". Reported-by: "Lawrence, Joe" <Joe.Lawrence@stratus.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Assemble.c')
-rw-r--r--Assemble.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Assemble.c b/Assemble.c
index a426afb0..25cfec1d 100644
--- a/Assemble.c
+++ b/Assemble.c
@@ -1383,7 +1383,7 @@ int Assemble(struct supertype *st, char *mddev,
* might allow them to be included, or
* they will become spares.
*/
- for (i = 0; i <= bestcnt; i++) {
+ for (i = 0; i < bestcnt; i++) {
int j = best[i];
if (j >= 0 && !devices[j].uptodate) {
if (!disk_action_allows(&devices[j].i, st->ss->name, act_re_add))