Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Sep 2014 06:56:46 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r271358 - head/sys/cam/ctl
Message-ID:  <201409100656.s8A6uk4k068038@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Wed Sep 10 06:56:45 2014
New Revision: 271358
URL: http://svnweb.freebsd.org/changeset/base/271358

Log:
  Fix array overrun, reported by Coverity.
  
  CID:		1229970

Modified:
  head/sys/cam/ctl/ctl.c

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Wed Sep 10 06:56:09 2014	(r271357)
+++ head/sys/cam/ctl/ctl.c	Wed Sep 10 06:56:45 2014	(r271358)
@@ -7963,7 +7963,8 @@ retry:
 			scsi_ulto2b(i / CTL_MAX_INIT_PER_PORT,
 			    res_desc->rel_trgt_port_id);
 			len = 0;
-			port = softc->ctl_ports[i / CTL_MAX_INIT_PER_PORT];
+			port = softc->ctl_ports[
+			    ctl_port_idx(i / CTL_MAX_INIT_PER_PORT)];
 			if (port != NULL)
 				len = ctl_create_iid(port,
 				    i % CTL_MAX_INIT_PER_PORT,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409100656.s8A6uk4k068038>