]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Fix array-subscript error.
authorNeil Brown <neilb@suse.de>
Thu, 19 Oct 2006 06:38:20 +0000 (16:38 +1000)
committerNeil Brown <neilb@suse.de>
Thu, 19 Oct 2006 06:38:20 +0000 (16:38 +1000)
->name is sized to '33' to have room for a trailing nul,
but thhat needs to get put in position '32'.  Doh!

super1.c

index cbf4d38d644b7875a2a0c559e80a6689bdb2ad1a..9b643587296fe58471c784dca9322ba559532ab2 100644 (file)
--- a/super1.c
+++ b/super1.c
@@ -546,7 +546,7 @@ static int update_super1(struct mdinfo *info, void *sbv, char *update,
                        strncpy(info->name, c+1, 31 - (c-sb->set_name));
                else
                        strncpy(info->name, sb->set_name, 32);
-               info->name[33] = 0;
+               info->name[32] = 0;
        }
        if (strcmp(update, "name") == 0) {
                if (info->name[0] == 0)