]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
fsck.minix: fix "array subscript is above array bounds"
authorKarel Zak <kzak@redhat.com>
Thu, 21 Jul 2011 11:00:40 +0000 (13:00 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 21 Jul 2011 11:00:40 +0000 (13:00 +0200)
fsck.minix.c: In function ‘map_block2’:
fsck.minix.c:486:9: warning: array subscript is above array bounds [-Warray-bounds]

The 'blknr' has to be bigger than 7 + 256 + (256 * 256) for i_zone[9].

Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/fsck.minix.c

index 566624abd7bd5e53fbec3eeb23607023d884fd2b..e633b91462b45e163ce54fa73d552c6b190a7234 100644 (file)
@@ -459,7 +459,7 @@ map_block2 (struct minix2_inode *inode, unsigned int blknr) {
                return result;
        }
        blknr -= 256;
-       if (blknr >= 256 * 256) {
+       if (blknr < 256 * 256) {
                block = check_zone_nr2 (inode->i_zone + 8, &changed);
                read_block (block, (char *) dind);
                blk_chg = 0;