[Spice-devel] [PATCH spice-gtk] Fix incorrect array size check

Hans de Goede hdegoede at redhat.com
Thu Mar 15 01:40:22 PDT 2012


Ack.

On 03/14/2012 11:26 PM, Marc-André Lureau wrote:
> ---
>   gtk/spice-channel.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/gtk/spice-channel.c b/gtk/spice-channel.c
> index 77b066e..be95f00 100644
> --- a/gtk/spice-channel.c
> +++ b/gtk/spice-channel.c
> @@ -1863,7 +1863,7 @@ const gchar* spice_channel_type_to_string(gint type)
>       };
>       const char *str = NULL;
>
> -    if (type>= 0&&  type<  sizeof(to_string)) {
> +    if (type>= 0&&  type<  G_N_ELEMENTS(to_string)) {
>           str = to_string[type];
>       }
>


More information about the Spice-devel mailing list