qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] qga: fix an off-by-one issue


From: Philippe Mathieu-Daudé
Subject: Re: [Qemu-devel] [PATCH] qga: fix an off-by-one issue
Date: Thu, 18 Oct 2018 12:30:50 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0

Missed in a3ef3b2272d.

On 18/10/2018 04:10, Li Qiang wrote:
> Signed-off-by: Li Qiang <address@hidden>

Nice catch btw.

Reviewed-by: Philippe Mathieu-Daudé <address@hidden>

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]