From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:52544) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJ2ak-0007wF-OD for qemu-devel@nongnu.org; Wed, 26 Oct 2011 08:28:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RJ2aj-0008BR-M4 for qemu-devel@nongnu.org; Wed, 26 Oct 2011 08:28:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36052) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJ2aj-0008Az-Cw for qemu-devel@nongnu.org; Wed, 26 Oct 2011 08:28:21 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p9QCSK24029991 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 26 Oct 2011 08:28:20 -0400 From: Kevin Wolf Date: Wed, 26 Oct 2011 14:31:19 +0200 Message-Id: <1319632282-22725-5-git-send-email-kwolf@redhat.com> In-Reply-To: <1319632282-22725-1-git-send-email-kwolf@redhat.com> References: <1319632282-22725-1-git-send-email-kwolf@redhat.com> Subject: [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: qemu-devel@nongnu.org Cc: kwolf@redhat.com 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]; -- 1.7.6.4