From patchwork Thu Oct 18 02:10:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Li Qiang X-Patchwork-Id: 10646673 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BE30613A4 for ; Thu, 18 Oct 2018 02:11:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ACD9828B09 for ; Thu, 18 Oct 2018 02:11:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9B81928B0B; Thu, 18 Oct 2018 02:11:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4429E28B09 for ; Thu, 18 Oct 2018 02:11:55 +0000 (UTC) Received: from localhost ([::1]:39850 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gCxn0-0006B3-A6 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 17 Oct 2018 22:11:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58482) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gCxlw-0005an-V4 for qemu-devel@nongnu.org; Wed, 17 Oct 2018 22:10:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gCxls-0001c8-1q for qemu-devel@nongnu.org; Wed, 17 Oct 2018 22:10:48 -0400 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]:40484) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gCxlr-0001aH-Rg for qemu-devel@nongnu.org; Wed, 17 Oct 2018 22:10:43 -0400 Received: by mail-pg1-x543.google.com with SMTP id n31-v6so13422269pgm.7 for ; Wed, 17 Oct 2018 19:10:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=mOPiW16H9oahcuperaU+/jY/fJwVbS1Kf3vYlMg1XOk=; b=QiIx3Xw8oTPwAuJFI2dugOx6mh1UUHVWng4pKTDsBrBXOps05CQNNqp9kb80HCSJFt +wWCXALBEnThZXZuOraBgfWkUAary3DtcK3uDAQR4YAFX+eUQ8mVpbqLzpPeaw3sLQjm o/qqJPV+/W/8EgFYeRrcGb6uDSzGlkUUrIZqc0UbUmpNTflI7JBaVQDipPz9W9D3+xHj hwosrcsBfEPGSSTdhxQuvwpT9xXV9bNDjiWZ9hwpliBjKs/TzvQiu28Lc3zgtUfxKibF EGYD+TUG2wlb//nRfokCklmeXyF+qduUm0rCNBVMWCw6DLDHOi/2NeVPYOJPqtCy6jNu /Xow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=mOPiW16H9oahcuperaU+/jY/fJwVbS1Kf3vYlMg1XOk=; b=U+vrPpvVumTbzSFC85/Z0a4dyskwCGkLblyUuf3Y1qxwNfZnnQ97jmKeOmNtPMlIjz zCAFluEcLgGTR04I1QMwp4+J7OAv0GZ+4RgAtIBL84QlcnWZXyV5vdp35//E1KWMvFPt +m8/CM89is4rvmJSwsobeniq3EYvH+kfv1DdhjOV03AVQi55dpX6MyfrkQcwP+83JzMO /xFUYZVtZEIV1trtNSwMWTGlktD15QFovHpgw3hzaIGpaoIUmZ8VKAi/zQX/aLhjfCQJ vM7iQKKD3+VsZIC76mf3U55mocn+h/48Lhrp8s1H9poJyoRYjQcbxUcRIyKB3si7on+r vPsA== X-Gm-Message-State: ABuFfogyU/5TkELeC2M8qD77eeB3zrmhCjYC2nDJIl9bS258hhORgMm0 Vaw8NUtZf25csHf9DiJBZHo= X-Google-Smtp-Source: ACcGV61K3G11zLF1twx25LrDXwQYwdY+BHqoXDVRDiL3QNT1p4bjvy3A3odyMByQKcRzlyqJd3g/oQ== X-Received: by 2002:a63:3f07:: with SMTP id m7-v6mr27318363pga.115.1539828642771; Wed, 17 Oct 2018 19:10:42 -0700 (PDT) Received: from localhost.localdomain.localdomain ([103.65.40.100]) by smtp.gmail.com with ESMTPSA id h6-v6sm26104535pfc.6.2018.10.17.19.10.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Oct 2018 19:10:42 -0700 (PDT) From: Li Qiang To: mdroth@linux.vnet.ibm.com, qemu-devel@nongnu.org Date: Wed, 17 Oct 2018 19:10:37 -0700 Message-Id: <1539828637-2907-1-git-send-email-liq3ea@gmail.com> X-Mailer: git-send-email 1.8.3.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::543 Subject: [Qemu-devel] [PATCH] qga: fix an off-by-one issue X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Li Qiang Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Li Qiang 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];