Received: from eggs.gnu.org ([2001:4830:134:3::10]:55364) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8Vuy-0000Cn-CV for qemu-devel@nongnu.org; Fri, 26 Jun 2015 11:51:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z8Vux-0003VS-FF for qemu-devel@nongnu.org; Fri, 26 Jun 2015 11:51:52 -0400 Date: Fri, 26 Jun 2015 16:51:43 +0100 From: Stefan Hajnoczi Message-ID: <20150626155143.GE31186@stefanha-thinkpad.redhat.com> References: <1435018875-22527-1-git-send-email-jsnow@redhat.com> <1435018875-22527-14-git-send-email-jsnow@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/2994txjAzEdQwm5" Content-Disposition: inline In-Reply-To: <1435018875-22527-14-git-send-email-jsnow@redhat.com> Subject: Re: [Qemu-devel] [PATCH 13/16] ahci: add get_cmd_header helper List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Snow Cc: kwolf@redhat.com, pbonzini@redhat.com, qemu-devel@nongnu.org, qemu-block@nongnu.org --/2994txjAzEdQwm5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Jun 22, 2015 at 08:21:12PM -0400, John Snow wrote: > +static AHCICmdHdr *get_cmd_header(AHCIState *s, uint8_t port, uint8_t slot) > +{ > + if (port > s->ports || slot > AHCI_MAX_CMDS) { Should these be >= instead of >? Otherwise 1 element beyond the end of the array can be accessed. --/2994txjAzEdQwm5 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVjXUPAAoJEJykq7OBq3PIDxIH/0LQCY+B8pst/HQfqgg84TEP xkLGNrKr9aUcVbpgxrHHtaGdU7GDv3CO0Go59Wvru4ctYg2ospizSXQehd9798Yg 0e1EoHrBrVuhaxoI9uOthY39/MYU7tZvD1sQxS0qW22371qK+xaGAlbCrz5v9BMK BDqV3t/3txt3Xm8mVI4VhW1GsJtVpsPZoA4/M82UiOM6JKafDmHB0Nd2IoPMHmvW P9WkrcL4RuFwdKlAI98FcUtIXGq3ZeYpmCkfG4nfV5TXXn6ajAK2EiMvBtaYIAXz BNJ3rKx9YEsjC3MQ67kY7uDq9dW3hWl3L3inxNt/UjX2I+IN0BHDb9MPEKkcbSw= =TRGf -----END PGP SIGNATURE----- --/2994txjAzEdQwm5--