]> git.ipfire.org Git - thirdparty/mdadm.git/commit - bitmap.c
Cast to long long before left-shifting too much.
authorNeilBrown <neilb@suse.de>
Thu, 22 Jul 2010 05:28:15 +0000 (15:28 +1000)
committerNeilBrown <neilb@suse.de>
Thu, 22 Jul 2010 05:35:54 +0000 (15:35 +1000)
commit3e4165619b146d3134838c6546778c02308c462e
tree37c2b8e1ce7f22108671e9fd40d3e22101b7cc27
parent50526e9090d0c118b065840719bc9601be8af8b8
Cast to long long before left-shifting too much.

When left-shifting we must be sure that the value being
shifted is large enough to not lose bits.
The 'chunkssize' in CreateBitmap is only 'long' so it
can overflow.  So cast to 'long long' first.

Also fix a similar issue in Detail even though it isn't currently
being compiled.

Signed-off-by: NeilBrown <neilb@suse.de>
Reported-by: Tomasz Chmielewski <mangoo@wpkg.org>
Detail.c
bitmap.c