public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: "James E.J. Bottomley" <James.Bottomley@suse.de>
Cc: linux-scsi@vger.kernel.org
Subject: [patch] off by one in FlashPoint.c
Date: Sun, 27 Dec 2009 15:14:46 +0200	[thread overview]
Message-ID: <20091227131446.GI6075@bicker> (raw)

The check should be >= instead of > or we could go past the end of the
array.

Signed-off-by: Dan Carpenter <error27@gmail.com>

--- orig/drivers/scsi/FlashPoint.c	2009-12-27 11:35:58.000000000 +0200
+++ devel/drivers/scsi/FlashPoint.c	2009-12-27 11:36:19.000000000 +0200
@@ -3924,7 +3924,7 @@
 {
 	struct sccb_mgr_tar_info *currTar_Info;
 
-	if ((p_sccb->TargID > MAX_SCSI_TAR) || (p_sccb->Lun > MAX_LUN)) {
+	if ((p_sccb->TargID >= MAX_SCSI_TAR) || (p_sccb->Lun > MAX_LUN)) {
 		return;
 	}
 	currTar_Info = &FPT_sccbMgrTbl[p_card][p_sccb->TargID];



             reply	other threads:[~2009-12-27 13:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-27 13:14 Dan Carpenter [this message]
2009-12-28 17:14 ` [patch] off by one in FlashPoint.c Joe Eykholt
2009-12-28 18:03   ` Dan Carpenter
2009-12-28 18:08   ` [patch] off by one in FlashPoint.c (v2) Dan Carpenter

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=20091227131446.GI6075@bicker \
    --to=error27@gmail.com \
    --cc=James.Bottomley@suse.de \
    --cc=linux-scsi@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