]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
libext2fs: Fix reading bitmaps from e2image files
authorTheodore Ts'o <tytso@mit.edu>
Thu, 21 Aug 2008 21:56:44 +0000 (17:56 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 21 Aug 2008 21:56:44 +0000 (17:56 -0400)
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" <tytso@mit.edu>
lib/ext2fs/rw_bitmaps.c

index b7fda5a14829c90a140ea4e34482d944c73d1ec0..d3bdc2aca26cf09288748b44a0019735dba5ea7e 100644 (file)
@@ -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