mirror of https://github.com/vitalif/e2fsprogs
blkid: Make sure the blocksize in reiserfs is sane
This avoids a floating point exception for corrupt reiserfs images Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>bitmap-optimize
parent
3e9f86326d
commit
4dc30dac2c
|
@ -596,6 +596,10 @@ static int probe_reiserfs(struct blkid_probe *probe,
|
|||
|
||||
blocksize = blkid_le16(rs->rs_blocksize);
|
||||
|
||||
/* The blocksize must be at least 1k */
|
||||
if ((blocksize >> 10) == 0)
|
||||
return -BLKID_ERR_PARAM;
|
||||
|
||||
/* If the superblock is inside the journal, we have the wrong one */
|
||||
if (id->bim_kboff/(blocksize>>10) > blkid_le32(rs->rs_journal_block))
|
||||
return -BLKID_ERR_BIG;
|
||||
|
|
Loading…
Reference in New Issue