From c595ceac1ad8c40aec85318e07424e5b6f338dad Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Fri, 18 Mar 2016 00:12:23 +0100 Subject: ext2fs: Fix off-by-one * ext2fs/pager.c (disk_cache_init): Do not add disk_cache_info[disk_cache_blocks] to disk_cache_info_free. --- ext2fs/pager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext2fs') diff --git a/ext2fs/pager.c b/ext2fs/pager.c index d3954722..7d3a8f37 100644 --- a/ext2fs/pager.c +++ b/ext2fs/pager.c @@ -914,7 +914,7 @@ disk_cache_init (void) /* Initialize disk_cache_info. Start with the last entry so that the first ends up at the front of the free list. This keeps the assertions at the end of this function happy. */ - for (int i = disk_cache_blocks; i >= 0; i--) + for (int i = disk_cache_blocks - 1; i >= 0; i--) { disk_cache_info[i].block = DC_NO_BLOCK; disk_cache_info[i].flags = 0; -- cgit v1.2.3