]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Fix a possible overflow when shifting a sector size to a byte count
authorNeil Brown <neilb@suse.de>
Tue, 14 Jun 2005 01:06:42 +0000 (01:06 +0000)
committerNeil Brown <neilb@suse.de>
Tue, 14 Jun 2005 01:06:42 +0000 (01:06 +0000)
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
util.c

diff --git a/util.c b/util.c
index 3a4a0853f49b0707b5aefa8879b46f42f5ff3f64..5bac0ec4003ed6123931378d64c18163df716f41 100644 (file)
--- a/util.c
+++ b/util.c
@@ -221,8 +221,10 @@ int load_super(int fd, mdp_super_t *super)
        {
                if (ioctl(fd, BLKGETSIZE, &size))
                        return 1;
-               else
-                       dsize = size << 9;
+               else {
+                       dsize = size;
+                       dsize <<= 9;
+               }
        }
 
        if (dsize < MD_RESERVED_SECTORS*2)