Skip to content
Snippets Groups Projects
Unverified Commit 1c6e6e69 authored by Richard Cordovano's avatar Richard Cordovano Committed by GitHub
Browse files

Merge pull request #1906 from sleuthkit/release-4.9.0

Merge in release-4.9.0 to get ext2 bug fix
parents 4ea4cd14 57f44a2b
No related branches found
No related tags found
No related merge requests found
......@@ -841,6 +841,20 @@ ext2fs_dinode_copy(EXT2FS_INFO * ext2fs, TSK_FS_META * fs_meta,
grp_num * tsk_getu32(fs->endian,
ext2fs->fs->s_inodes_per_group) + fs->first_inum;
/*
* Ensure that inum - ibase refers to a valid bit offset in imap_buf.
*/
if ((inum - ibase) > fs->block_size*8) {
tsk_release_lock(&ext2fs->lock);
tsk_error_reset();
tsk_error_set_errno(TSK_ERR_FS_WALK_RNG);
tsk_error_set_errstr("ext2fs_dinode_copy: Invalid offset into imap_buf (inum %" PRIuINUM " - ibase %" PRIuINUM ")",
inum, ibase);
return 1;
}
/*
* Apply the allocated/unallocated restriction.
*/
......@@ -1052,9 +1066,9 @@ ext2fs_inode_walk(TSK_FS_INFO * fs, TSK_INUM_T start_inum,
ext2fs->fs->s_inodes_per_group) + 1;
/*
* Ensure that inum - ibase refers to a valid offset in imap_buf.
* Ensure that inum - ibase refers to a valid bit offset in imap_buf.
*/
if ((inum - ibase) > fs->block_size) {
if ((inum - ibase) > fs->block_size*8) {
tsk_release_lock(&ext2fs->lock);
free(dino_buf);
tsk_error_reset();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment