diff options
author | Li Qiang | 2018-10-18 04:10:37 +0200 |
---|---|---|
committer | Michael Roth | 2018-10-31 15:04:20 +0100 |
commit | d9c85b6cc5a2597e72299bc6644c966236378e50 (patch) | |
tree | ebeeea9489046a548997782a22dc32003c08eedf /qga | |
parent | qga-win: demystify namespace stripping (diff) | |
download | qemu-d9c85b6cc5a2597e72299bc6644c966236378e50.tar.gz qemu-d9c85b6cc5a2597e72299bc6644c966236378e50.tar.xz qemu-d9c85b6cc5a2597e72299bc6644c966236378e50.zip |
qga: fix an off-by-one issue
Signed-off-by: Li Qiang <liq3ea@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Diffstat (limited to 'qga')
-rw-r--r-- | qga/commands-win32.c | 2 |
1 files changed, 1 insertions, 1 deletions
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]; |