public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Jones <davej@redhat.com>
To: aia21@cantab.net
Cc: Linux Kernel <linux-kernel@vger.kernel.org>
Subject: NTFS null dereference x2
Date: Fri, 16 Apr 2004 22:47:43 +0100	[thread overview]
Message-ID: <20040416214743.GU20937@redhat.com> (raw)

if vol is NULL, everything falls apart..

		Dave

--- linux-2.6.5/fs/ntfs/attrib.c~	2004-04-16 22:45:53.000000000 +0100
+++ linux-2.6.5/fs/ntfs/attrib.c	2004-04-16 22:46:47.000000000 +0100
@@ -1235,16 +1235,19 @@
 	u8 *al_end = al + initialized_size;
 	run_list_element *rl;
 	struct buffer_head *bh;
-	struct super_block *sb = vol->sb;
+	struct super_block *sb;
 	unsigned long block_size = sb->s_blocksize;
 	unsigned long block, max_block;
 	int err = 0;
-	unsigned char block_size_bits = sb->s_blocksize_bits;
+	unsigned char block_size_bits;
 
 	ntfs_debug("Entering.");
 	if (!vol || !run_list || !al || size <= 0 || initialized_size < 0 ||
 			initialized_size > size)
 		return -EINVAL;
+	sb = vol->sb;
+	block_size_bits = sb->s_blocksize_bits;
+
 	if (!initialized_size) {
 		memset(al, 0, size);
 		return 0;

             reply	other threads:[~2004-04-16 21:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-16 21:47 Dave Jones [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-04-17 13:47 NTFS null dereference x2 Szakacsits Szabolcs
2004-04-23 11:04 ` Anton Altaparmakov

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=20040416214743.GU20937@redhat.com \
    --to=davej@redhat.com \
    --cc=aia21@cantab.net \
    --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