Permalink
Browse files

Fix #6327 - FPE (div-by-zero) in grub/ext2

  • Loading branch information...
radare committed Dec 15, 2016
1 parent 4ae6321 commit 3ca5f5f1f7ff4ca8fbbabc6c61a4bb04d04adbd9
Showing with 3 additions and 0 deletions.
  1. +3 −0 shlr/grub/fs/ext2.c
View
@@ -524,6 +524,9 @@ grub_ext2_read_inode (struct grub_ext2_data *data,
return grub_errno;
inodes_per_block = EXT2_BLOCK_SIZE (data) / EXT2_INODE_SIZE (data);
if (inodes_per_block < 1) {
return grub_errno = GRUB_ERR_BAD_FS;
}
blkno = (ino % grub_le_to_cpu32 (sblock->inodes_per_group))
/ inodes_per_block;
blkoff = (ino % grub_le_to_cpu32 (sblock->inodes_per_group))

0 comments on commit 3ca5f5f

Please sign in to comment.