Skip to contentSkip to conversation

udf: possible null pointer dereference while load_partition

PATCH New Dmitriy Monakhov 1 participant 1 message Mar 4, 2007 UDF filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 udf: possible null pointer dereference while load_partition

sb_read may return NULL, let's explicitly check it.

fs/udf/super.c +2 -0
index f4b3265..951b85d 100644
@@ -1407,6 +1407,8 @@ udf_load_partition(struct super_block *sb, kernel_lb_addr *fileset)
 
 					pos = udf_block_map(UDF_SB_VAT(sb), 0);
 					bh = sb_bread(sb, pos);
+					if (!bh)
+						return 1;
 					UDF_SB_TYPEVIRT(sb,i).s_start_offset =
 						le16_to_cpu(((struct virtualAllocationTable20 *)bh->b_data + udf_ext0_offset(UDF_SB_VAT(sb)))->lengthHeader) +
 							udf_ext0_offset(UDF_SB_VAT(sb));