From 0155af90d8352d3ca031347e75854b3a5a4052ac Mon Sep 17 00:00:00 2001 From: Doug Ledford Date: Tue, 20 Jul 2010 17:35:27 -0400 Subject: Bugfix: don't issue a read larger than the buffer to hold it Signed-off-by: Doug Ledford --- Grow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Grow.c b/Grow.c index 3923a90..dd05d4d 100644 --- a/Grow.c +++ b/Grow.c @@ -1820,7 +1820,7 @@ int Grow_restart(struct supertype *st, struct mdinfo *info, int *fdlist, int cnt } /* There should be a duplicate backup superblock 4k before here */ if (lseek64(fd, -4096, 1) < 0 || - read(fd, &bsb2, 4096) != 4096) + read(fd, &bsb2, sizeof(bsb2)) != sizeof(bsb2)) goto second_fail; /* Cannot find leading superblock */ if (bsb.magic[15] == '1') bsbsize = offsetof(struct mdp_backup_super, pad1); -- cgit