Skip to content

Commit

Permalink
udf: possible null pointer dereference while load_partition
Browse files Browse the repository at this point in the history
sb_read may return NULL, let's explicitly check it.

Signed-off-by: Dmitriy Monakhov <dmonakhov@openvz.org>
Cc: Jan Kara <jack@ucw.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Dmitriy Monakhov authored and Linus Torvalds committed May 8, 2007
1 parent 31170b6 commit 951744f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/udf/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -1403,6 +1403,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));
Expand Down

0 comments on commit 951744f

Please sign in to comment.