lkml.org 
[lkml]   [2007]   [Mar]   [4]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[patch] udf: possible null pointer dereference while load_partition
FromDmitriy Monakhov <>
DateSun, 04 Mar 2007 11:30:34 +0300
sb_read may return NULL, let's explicitly check it.
Signed-off-by: Dmitriy Monakhov <dmonakhov@openvz.org>

diff --git a/fs/udf/super.c b/fs/udf/super.c
index f4b3265..951b85d 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -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));
\
 
 \ /
  Last update: 2007-03-04 09:33    [from the cache]
©2003-2008