Re: [spice-gtk] Avoid to access array with negative numbers

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

 



Hi,

according to GdkEventButton documentation [0] the 'button' is guint so
the button_gdk_to_spice() should take guint instead of int.

Pavel

[0] https://developer.gnome.org/gdk3/stable/gdk3-Event-Structures.html#
GdkEventButton

On Wed, 2016-03-23 at 15:28 +0000, Frediano Ziglio wrote:
> ---
>  src/spice-widget.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/spice-widget.c b/src/spice-widget.c
> index 19753e7..d2fd789 100644
> --- a/src/spice-widget.c
> +++ b/src/spice-widget.c
> @@ -1549,7 +1549,7 @@ static int button_gdk_to_spice(int gdk)
>          [ 5 ] = SPICE_MOUSE_BUTTON_DOWN,
>      };
>  
> -    if (gdk < SPICE_N_ELEMENTS(map)) {
> +    if (gdk >= 0 && gdk < SPICE_N_ELEMENTS(map)) {
>          return map [ gdk ];
>      }
>      return 0;
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]