From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46361) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHVGJ-0007dI-F2 for qemu-devel@nongnu.org; Tue, 30 Oct 2018 10:44:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gHVGE-0000LS-Cf for qemu-devel@nongnu.org; Tue, 30 Oct 2018 10:44:55 -0400 Received: from mail-qt1-x830.google.com ([2607:f8b0:4864:20::830]:36249) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gHVGE-0000K5-6i for qemu-devel@nongnu.org; Tue, 30 Oct 2018 10:44:50 -0400 Received: by mail-qt1-x830.google.com with SMTP id u34-v6so13727171qth.3 for ; Tue, 30 Oct 2018 07:44:50 -0700 (PDT) Sender: fluxion From: Michael Roth Date: Tue, 30 Oct 2018 09:43:51 -0500 Message-Id: <20181030144358.23144-18-mdroth@linux.vnet.ibm.com> In-Reply-To: <20181030144358.23144-1-mdroth@linux.vnet.ibm.com> References: <20181030144358.23144-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 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