From 7823dd65722c50eeca98b2dde1c9a629e72fffe7 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Fri, 17 May 2002 23:37:42 -0400 Subject: [PATCH] Fix fencepost error in allocating space for array. --- e2fsck/pass1.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c index 8e04846..d252bb7 100644 --- a/e2fsck/pass1.c +++ b/e2fsck/pass1.c @@ -103,7 +103,8 @@ struct scan_callback_struct { static struct process_inode_block *inodes_to_process; static int process_inode_count; -static __u64 ext2_max_sizes[EXT2_MAX_BLOCK_LOG_SIZE - EXT2_MIN_BLOCK_LOG_SIZE]; +static __u64 ext2_max_sizes[EXT2_MAX_BLOCK_LOG_SIZE - + EXT2_MIN_BLOCK_LOG_SIZE + 1]; /* * Free all memory allocated by pass1 in preparation for restarting @@ -273,7 +274,7 @@ void e2fsck_pass1(e2fsck_t ctx) max_sizes = max_sizes + EXT2_BPP(i) * EXT2_BPP(i); max_sizes = max_sizes + EXT2_BPP(i) * EXT2_BPP(i) * EXT2_BPP(i); max_sizes = (max_sizes * (1UL << i)) - 1; - ext2_max_sizes[i - 10] = max_sizes; + ext2_max_sizes[i - EXT2_MIN_BLOCK_LOG_SIZE] = max_sizes; } #undef EXT2_BPP -- 1.8.3.1