diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-08-08 01:39:08 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-08-08 02:28:06 +0200 |
commit | a11b544b4a4d4895224671c6b59556666e0a7512 (patch) | |
tree | 45c0e17f2401b9c9389ed0bcc116b54b3d9a2425 /ext2fs | |
parent | b0ea438723d4943a0164479e338313eb98e368db (diff) | |
download | hurd-a11b544b4a4d4895224671c6b59556666e0a7512.tar.gz hurd-a11b544b4a4d4895224671c6b59556666e0a7512.tar.bz2 hurd-a11b544b4a4d4895224671c6b59556666e0a7512.zip |
ext2fs: Fix shift in find_next_zero_bit
Shifting unsigned 32bit right by 32 bits is undefined, so avoid this.
Diffstat (limited to 'ext2fs')
-rw-r--r-- | ext2fs/bitmap.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ext2fs/bitmap.c b/ext2fs/bitmap.c index c440c8b1..cf7702d7 100644 --- a/ext2fs/bitmap.c +++ b/ext2fs/bitmap.c @@ -70,7 +70,8 @@ find_next_zero_bit(void *addr, unsigned long size, unsigned long offset) if (offset) { tmp = *(p++); - tmp |= ~0UL >> (32-offset); + if (offset) + tmp |= ~0UL >> (32-offset); if (size < 32) goto found_first; if (~tmp) |