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: 985662 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="QiIx3Xw8"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42bCG65td3z9sB5 for ; Thu, 18 Oct 2018 13:11:26 +1100 (AEDT) Received: from localhost ([::1]:39848 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gCxmW-0005cL-Ey for incoming@patchwork.ozlabs.org; Wed, 17 Oct 2018 22:11:24 -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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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];