summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2023-08-08 01:35:48 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-08-08 02:28:06 +0200
commitb0ea438723d4943a0164479e338313eb98e368db (patch)
treea8fc967b6de8fef239232530b13a5e31b59ebfe2
parent3bc9a699ca7106204ffa97272374313bf04f6cc0 (diff)
ext2fs: Fix shift in ext2_new_block
Shifting signed integers left by 31 bits is not representable, so better make sure to use unsigned integers.
-rw-r--r--ext2fs/balloc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext2fs/balloc.c b/ext2fs/balloc.c
index c921c0ca..14c18b5d 100644
--- a/ext2fs/balloc.c
+++ b/ext2fs/balloc.c
@@ -220,8 +220,8 @@ repeat:
lmap |= (((uint32_t *) bh)[(j >> 5) + 1]) <<
(31 - (j & 31));
else
- lmap |= 0xffffffff << (31 - (j & 31));
- if (lmap != 0xffffffffl)
+ lmap |= 0xffffffffu << (31 - (j & 31));
+ if (lmap != 0xffffffffu)
{
k = ffz (lmap) + 1;
if ((j + k) < le32toh (sblock->s_blocks_per_group))