From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60307) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHfUs-0000YI-Ha for qemu-devel@nongnu.org; Tue, 30 Oct 2018 21:40:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gHfUp-0002GF-OX for qemu-devel@nongnu.org; Tue, 30 Oct 2018 21:40:38 -0400 Received: from mail-qt1-x832.google.com ([2607:f8b0:4864:20::832]:42446) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gHfUo-0002BT-7t for qemu-devel@nongnu.org; Tue, 30 Oct 2018 21:40:34 -0400 Received: by mail-qt1-x832.google.com with SMTP id z20-v6so15959556qti.9 for ; Tue, 30 Oct 2018 18:40:26 -0700 (PDT) Sender: fluxion From: Michael Roth Date: Tue, 30 Oct 2018 20:38:14 -0500 Message-Id: <20181031013821.24023-18-mdroth@linux.vnet.ibm.com> In-Reply-To: <20181031013821.24023-1-mdroth@linux.vnet.ibm.com> References: <20181031013821.24023-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PULL v2 17/24] qga: fix an off-by-one issue List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, Li Qiang From: Li Qiang Signed-off-by: Li Qiang Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Michael Roth --- 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 a1b7512d46..ef1d7d48d2 100644 --- a/qga/commands-win32.c +++ b/qga/commands-win32.c @@ -485,7 +485,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]; -- 2.17.1