From: Dmitriy Monakhov <dmonakhov@openvz.org>
To: bfennema@falcon.csc.calpoly.edu
Cc: linux-kernel@vger.kernel.org
Subject: [patch] udf: possible null pointer dereference while load_partition
Date: Sun, 04 Mar 2007 11:30:34 +0300 [thread overview]
Message-ID: <87abytl8b9.fsf@sw.ru> (raw)
[-- Attachment #1: Type: text/plain, Size: 109 bytes --]
sb_read may return NULL, let's explicitly check it.
Signed-off-by: Dmitriy Monakhov <dmonakhov@openvz.org>
[-- Attachment #2: diff-mm-udf-load_partition-sb_read-errh-fix --]
[-- Type: text/plain, Size: 521 bytes --]
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));
reply other threads:[~2007-03-04 8:30 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87abytl8b9.fsf@sw.ru \
--to=dmonakhov@openvz.org \
--cc=bfennema@falcon.csc.calpoly.edu \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox