Received: from eggs.gnu.org ([2001:4830:134:3::10]:55479) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gD5a1-000159-Gp for qemu-devel@nongnu.org; Thu, 18 Oct 2018 06:31:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gD5Zw-0003Co-BG for qemu-devel@nongnu.org; Thu, 18 Oct 2018 06:31:01 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:51694) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gD5Zw-00038h-4P for qemu-devel@nongnu.org; Thu, 18 Oct 2018 06:30:56 -0400 Received: by mail-wm1-f68.google.com with SMTP id 143-v6so4870937wmf.1 for ; Thu, 18 Oct 2018 03:30:55 -0700 (PDT) References: <1539828637-2907-1-git-send-email-liq3ea@gmail.com> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= Message-ID: Date: Thu, 18 Oct 2018 12:30:50 +0200 MIME-Version: 1.0 In-Reply-To: <1539828637-2907-1-git-send-email-liq3ea@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH] qga: fix an off-by-one issue List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Li Qiang , mdroth@linux.vnet.ibm.com, qemu-devel@nongnu.org Missed in a3ef3b2272d. On 18/10/2018 04:10, Li Qiang wrote: > Signed-off-by: Li Qiang Nice catch btw. Reviewed-by: Philippe Mathieu-Daudé > --- > qga/commands-win32.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/qga/commands-win32.c b/qga/commands-win32.c > index 98d9735..e3842d1 100644 > --- a/qga/commands-win32.c > +++ b/qga/commands-win32.c > @@ -465,7 +465,7 @@ static STORAGE_BUS_TYPE win2qemu[] = { > > static GuestDiskBusType find_bus_type(STORAGE_BUS_TYPE bus) > { > - if (bus > ARRAY_SIZE(win2qemu) || (int)bus < 0) { > + if (bus >= ARRAY_SIZE(win2qemu) || (int)bus < 0) { > return GUEST_DISK_BUS_TYPE_UNKNOWN; > } > return win2qemu[(int)bus]; >