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>
This commit is contained in:
Li Qiang 2018-10-17 19:10:37 -07:00 committed by Michael Roth
parent 7fae518479
commit d9c85b6cc5
1 changed files with 1 additions and 1 deletions

View File

@ -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];