From owner-svn-src-head@FreeBSD.ORG Wed Sep 10 06:56:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 55D33166; Wed, 10 Sep 2014 06:56:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 41EE8162; Wed, 10 Sep 2014 06:56:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8A6ukUG068039; Wed, 10 Sep 2014 06:56:46 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8A6uk4k068038; Wed, 10 Sep 2014 06:56:46 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409100656.s8A6uk4k068038@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 10 Sep 2014 06:56:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271358 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Sep 2014 06:56:46 -0000 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,