From: Neil Brown Date: Tue, 14 Jun 2005 01:06:42 +0000 (+0000) Subject: Fix a possible overflow when shifting a sector size to a byte count X-Git-Tag: mdadm-1.12.0~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d74c6de8d18ae40a6dec8e8ef804f72ce2b60f21;p=thirdparty%2Fmdadm.git Fix a possible overflow when shifting a sector size to a byte count Signed-off-by: Neil Brown --- diff --git a/util.c b/util.c index 3a4a0853..5bac0ec4 100644 --- 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)