Don't core dump if there is a corrupt htree interior node. If the block
number is larger than the number of blocks in the directory, don't write
past the end of malloc'ed memory.
Addresses SourceForge Bug: #1512778
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
+2006-10-21 Theodore Tso <tytso@mit.edu>
+
+ * pass2.c (parse_int_node): Don't core dump if there is a corrupt
+ htree interior node. If the block number is larger than
+ the number of blocks in the directory, don't write past
+ the end of malloc'ed memory. (Addresses SourceForge Bug:
+ #1512778)
+
2006-10-02 Theodore Tso <tytso@mit.edu>
* e2fsck.conf.5.in: Minor correction to man page.
#endif
blk = ext2fs_le32_to_cpu(ent[i].block) & 0x0ffffff;
/* Check to make sure the block is valid */
- if (blk > (blk_t) dx_dir->numblocks) {
+ if (blk >= (blk_t) dx_dir->numblocks) {
cd->pctx.blk = blk;
if (fix_problem(cd->ctx, PR_2_HTREE_BADBLK,
&cd->pctx))
goto clear_and_exit;
+ continue;
}
if (hash < prev_hash &&
fix_problem(cd->ctx, PR_2_HTREE_HASH_ORDER, &cd->pctx))