From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:54046) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJKSK-0006uM-Qk for qemu-devel@nongnu.org; Thu, 27 Oct 2011 03:32:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RJKSJ-0000rz-Ty for qemu-devel@nongnu.org; Thu, 27 Oct 2011 03:32:52 -0400 Received: from mail-pz0-f43.google.com ([209.85.210.43]:42200) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJKSJ-0000rv-JC for qemu-devel@nongnu.org; Thu, 27 Oct 2011 03:32:51 -0400 Received: by pzk33 with SMTP id 33so6305213pzk.2 for ; Thu, 27 Oct 2011 00:32:50 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4EA9091B.1010906@redhat.com> Date: Thu, 27 Oct 2011 09:32:43 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1319632282-22725-1-git-send-email-kwolf@redhat.com> <1319632282-22725-5-git-send-email-kwolf@redhat.com> In-Reply-To: <1319632282-22725-5-git-send-email-kwolf@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 4/7] ide: Fix off-by-one error in array index check List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org On 10/26/2011 02:31 PM, Kevin Wolf wrote: > Signed-off-by: Kevin Wolf > --- > hw/ide/core.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/hw/ide/core.c b/hw/ide/core.c > index 280a117..29305d3 100644 > --- a/hw/ide/core.c > +++ b/hw/ide/core.c > @@ -2039,7 +2039,7 @@ static int ide_drive_pio_post_load(void *opaque, int version_id) > { > IDEState *s = opaque; > > - if (s->end_transfer_fn_idx> ARRAY_SIZE(transfer_end_table)) { > + if (s->end_transfer_fn_idx>= ARRAY_SIZE(transfer_end_table)) { > return -EINVAL; > } > s->end_transfer_func = transfer_end_table[s->end_transfer_fn_idx]; Reviewed-by: Paolo Bonzini