From: Li Qiang Date: Thu, 18 Oct 2018 02:10:37 +0000 (-0700) Subject: qga: fix an off-by-one issue X-Git-Tag: v3.1.0-rc0~16^2~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d9c85b6cc5a2597e72299bc6644c966236378e50;p=thirdparty%2Fqemu.git qga: fix an off-by-one issue Signed-off-by: Li Qiang Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Michael Roth --- diff --git a/qga/commands-win32.c b/qga/commands-win32.c index a1b7512d462..ef1d7d48d2d 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];