From 57fd39e94339f6a60f3c1df0818e5305cdbb7569 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Thu, 21 Aug 2008 17:56:44 -0400 Subject: [PATCH] libext2fs: Fix reading bitmaps from e2image files Fix a signed vs. unsigned bug that was accidentally introduced in commit f1f115a7, which was introduced in e2fsprogs 1.41.0 Addresses-Debian-Bug: #495830 Signed-off-by: "Theodore Ts'o" --- lib/ext2fs/rw_bitmaps.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ext2fs/rw_bitmaps.c b/lib/ext2fs/rw_bitmaps.c index b7fda5a1..d3bdc2ac 100644 --- a/lib/ext2fs/rw_bitmaps.c +++ b/lib/ext2fs/rw_bitmaps.c @@ -139,8 +139,8 @@ static errcode_t read_bitmaps(ext2_filsys fs, int do_inode, int do_block) char *block_bitmap = 0, *inode_bitmap = 0; char *buf; errcode_t retval; - unsigned int block_nbytes = EXT2_BLOCKS_PER_GROUP(fs->super) / 8; - unsigned inode_nbytes = EXT2_INODES_PER_GROUP(fs->super) / 8; + int block_nbytes = EXT2_BLOCKS_PER_GROUP(fs->super) / 8; + int inode_nbytes = EXT2_INODES_PER_GROUP(fs->super) / 8; int csum_flag = 0; int do_image = fs->flags & EXT2_FLAG_IMAGE_FILE; unsigned int cnt; @@ -169,7 +169,7 @@ static errcode_t read_bitmaps(ext2_filsys fs, int do_inode, int do_block) if (retval) goto cleanup; retval = ext2fs_get_mem(do_image ? fs->blocksize : - block_nbytes, &block_bitmap); + (unsigned) block_nbytes, &block_bitmap); if (retval) goto cleanup; } else @@ -182,7 +182,7 @@ static errcode_t read_bitmaps(ext2_filsys fs, int do_inode, int do_block) if (retval) goto cleanup; retval = ext2fs_get_mem(do_image ? fs->blocksize : - inode_nbytes, &inode_bitmap); + (unsigned) inode_nbytes, &inode_bitmap); if (retval) goto cleanup; } else