From 1afa9308d2fdc889ab7847ddc9a9aa05ce1e5faa Mon Sep 17 00:00:00 2001 From: Jes Sorensen Date: Wed, 21 Mar 2012 08:00:26 +1100 Subject: [PATCH] init_super1() memset full buffer allocated for superblock Avoid possibly using stale data in bitmap and misc area of superblock. In addition, remove superfluous memsets already covered by memset of full superblock. Signed-off-by: Jes Sorensen Signed-off-by: NeilBrown --- super1.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/super1.c b/super1.c index f165f592..4da59917 100644 --- a/super1.c +++ b/super1.c @@ -848,7 +848,7 @@ static int init_super1(struct supertype *st, mdu_array_info_t *info, ": %s could not allocate superblock\n", __func__); return 0; } - memset(sb, 0, MAX_SB_SIZE); + memset(sb, 0, SUPER1_SIZE); st->sb = sb; if (info == NULL) { @@ -883,7 +883,6 @@ static int init_super1(struct supertype *st, mdu_array_info_t *info, sprintf(defname, "%d", info->md_minor); name = defname; } - memset(sb->set_name, 0, 32); if (homehost && strchr(name, ':')== NULL && strlen(homehost)+1+strlen(name) < 32) { -- 2.39.2