提交 951744fe 编写于 作者: D Dmitriy Monakhov 提交者: Linus Torvalds

udf: possible null pointer dereference while load_partition

sb_read may return NULL, let's explicitly check it.
Signed-off-by: NDmitriy Monakhov <dmonakhov@openvz.org>
Cc: Jan Kara <jack@ucw.cz>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 31170b6a
...@@ -1403,6 +1403,8 @@ udf_load_partition(struct super_block *sb, kernel_lb_addr *fileset) ...@@ -1403,6 +1403,8 @@ udf_load_partition(struct super_block *sb, kernel_lb_addr *fileset)
pos = udf_block_map(UDF_SB_VAT(sb), 0); pos = udf_block_map(UDF_SB_VAT(sb), 0);
bh = sb_bread(sb, pos); bh = sb_bread(sb, pos);
if (!bh)
return 1;
UDF_SB_TYPEVIRT(sb,i).s_start_offset = UDF_SB_TYPEVIRT(sb,i).s_start_offset =
le16_to_cpu(((struct virtualAllocationTable20 *)bh->b_data + udf_ext0_offset(UDF_SB_VAT(sb)))->lengthHeader) + le16_to_cpu(((struct virtualAllocationTable20 *)bh->b_data + udf_ext0_offset(UDF_SB_VAT(sb)))->lengthHeader) +
udf_ext0_offset(UDF_SB_VAT(sb)); udf_ext0_offset(UDF_SB_VAT(sb));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册