From: Theodore Ts'o Date: Sat, 29 May 1999 21:48:03 +0000 (+0000) Subject: ChangeLog, openfs.c: X-Git-Tag: E2FSPROGS-1_15~38 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=f0687a5e5724abf576c106e07363f2e437cc9883;p=tools%2Fe2fsprogs.git ChangeLog, openfs.c: openfs.c (ext2fs_open): Check to make sure that the number of blocks per group is not zero --- if so, it must be a bad superblock! --- diff --git a/lib/ext2fs/ChangeLog b/lib/ext2fs/ChangeLog index a0bba4f..3e6c4c4 100644 --- a/lib/ext2fs/ChangeLog +++ b/lib/ext2fs/ChangeLog @@ -1,3 +1,9 @@ +1999-05-03 + + * openfs.c (ext2fs_open): Check to make sure that the number of + blocks per group is not zero --- if so, it must be a bad + superblock! + 1999-01-09 Theodore Ts'o * Release of E2fsprogs 1.14 diff --git a/lib/ext2fs/openfs.c b/lib/ext2fs/openfs.c index 54aeedc..b0b433f 100644 --- a/lib/ext2fs/openfs.c +++ b/lib/ext2fs/openfs.c @@ -163,6 +163,10 @@ errcode_t ext2fs_open(const char *name, int flags, int superblock, /* * Read group descriptors */ + if ((EXT2_BLOCKS_PER_GROUP(fs->super)) == 0) { + retval = EXT2_ET_CORRUPT_SUPERBLOCK; + goto cleanup; + } fs->group_desc_count = (fs->super->s_blocks_count - fs->super->s_first_data_block + EXT2_BLOCKS_PER_GROUP(fs->super) - 1)