|
@@ -1340,7 +1340,7 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block,
|
|
BUG_ON(ident != TAG_IDENT_LVD);
|
|
BUG_ON(ident != TAG_IDENT_LVD);
|
|
lvd = (struct logicalVolDesc *)bh->b_data;
|
|
lvd = (struct logicalVolDesc *)bh->b_data;
|
|
table_len = le32_to_cpu(lvd->mapTableLength);
|
|
table_len = le32_to_cpu(lvd->mapTableLength);
|
|
- if (sizeof(*lvd) + table_len > sb->s_blocksize) {
|
|
|
|
|
|
+ if (table_len > sb->s_blocksize - sizeof(*lvd)) {
|
|
udf_err(sb, "error loading logical volume descriptor: "
|
|
udf_err(sb, "error loading logical volume descriptor: "
|
|
"Partition table too long (%u > %lu)\n", table_len,
|
|
"Partition table too long (%u > %lu)\n", table_len,
|
|
sb->s_blocksize - sizeof(*lvd));
|
|
sb->s_blocksize - sizeof(*lvd));
|