From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:40614) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RKrtv-0003iT-Jb for qemu-devel@nongnu.org; Mon, 31 Oct 2011 09:27:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RKrtp-00049G-1y for qemu-devel@nongnu.org; Mon, 31 Oct 2011 09:27:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56530) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RKrto-000497-Pw for qemu-devel@nongnu.org; Mon, 31 Oct 2011 09:27:37 -0400 From: Kevin Wolf Date: Mon, 31 Oct 2011 14:29:43 +0100 Message-Id: <1320067830-12093-9-git-send-email-kwolf@redhat.com> In-Reply-To: <1320067830-12093-1-git-send-email-kwolf@redhat.com> References: <1320067830-12093-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH 08/55] ide: Fix off-by-one error in array index check List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org Signed-off-by: Kevin Wolf Reviewed-by: Paolo Bonzini --- 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]; -- 1.7.6.4