Skip to content

Commit

Permalink
[SCSI] FlashPoint: fix off by one tests
Browse files Browse the repository at this point in the history
The check on MAX_SCSI_TAR should be >= instead of > or we could go past the
end of the array.

Joe Eykholt aslo correctly points out that the check on MAX_LUN should be
>= as well.  That matches with how it is used in the rest of the file.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
  • Loading branch information
Dan Carpenter authored and James Bottomley committed Jan 18, 2010
1 parent 0ed8570 commit 5d7ebb9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/scsi/FlashPoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -3924,7 +3924,7 @@ static void FPT_sinits(struct sccb *p_sccb, unsigned char p_card)
{
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];
Expand Down

0 comments on commit 5d7ebb9

Please sign in to comment.