Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIGFPE in tsk/fs/ext2fs.c #526

Closed
kefir- opened this issue Sep 22, 2015 · 1 comment
Closed

SIGFPE in tsk/fs/ext2fs.c #526

kefir- opened this issue Sep 22, 2015 · 1 comment

Comments

@kefir-
Copy link
Contributor

kefir- commented Sep 22, 2015

tsk/fs/ext2fs.c can get a SIGFPE because of a divide by zero on malformed input. This happens in this code, starting from line 3353:

        ext2fs->groups_count =
            (EXT2_GRPNUM_T) ((tsk_getu32(fs->endian,
                    ext2fs->fs->s_blocks_count) -
                ext2fs->first_data_block + tsk_getu32(fs->endian,
                    ext2fs->fs->s_blocks_per_group) -
                1) / tsk_getu32(fs->endian,
                ext2fs->fs->s_blocks_per_group));

where ext2fs->fs->s_blocks_per_group is zero. Here's a link to a sample image:

https://www.dropbox.com/s/dx48hv9rriv633v/ext2-sigfpe-blocks-per-group.dd?dl=0

I have another similar example, SIGFPE on line 558:

    grp_num = (EXT2_GRPNUM_T) ((dino_inum - fs->first_inum) /
        tsk_getu32(fs->endian, ext2fs->fs->s_inodes_per_group));

It looks like the same can happen several other places.

@bcarrier
Copy link
Member

Thanks. This was fixed as part of #543.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants