[Spice-devel] [PATCH spice-gtk] vnc keymap: fix incorrect table size
Hans de Goede
hdegoede at redhat.com
Mon Oct 15 09:57:26 PDT 2012
ACK.
On 10/15/2012 06:43 PM, Marc-André Lureau wrote:
> This lead to out of bound array access
> ---
> gtk/vncdisplaykeymap.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/gtk/vncdisplaykeymap.c b/gtk/vncdisplaykeymap.c
> index a6ef38c..bf79f9b 100644
> --- a/gtk/vncdisplaykeymap.c
> +++ b/gtk/vncdisplaykeymap.c
> @@ -197,7 +197,7 @@ const guint16 const *vnc_display_keymap_gdk2xtkbd_table(size_t *maplen)
> #ifdef GDK_WINDOWING_WIN32
> if (GDK_IS_WIN32_DISPLAY(dpy)) {
> VNC_DEBUG("Using Win32 virtual keycode mapping");
> - *maplen = sizeof(keymap_win322xtkbd);
> + *maplen = G_N_ELEMENTS(keymap_win322xtkbd);
> return keymap_win322xtkbd;
> }
> #endif
> @@ -205,7 +205,7 @@ const guint16 const *vnc_display_keymap_gdk2xtkbd_table(size_t *maplen)
> #ifdef GDK_WINDOWING_QUARTZ
> if (GDK_IS_QUARTZ_DISPLAY(dpy)) {
> VNC_DEBUG("Using OS-X virtual keycode mapping");
> - *maplen = sizeof(keymap_osx2xtkbd);
> + *maplen = G_N_ELEMENTS(keymap_osx2xtkbd);
> return keymap_osx2xtkbd;
> }
> #endif
>
More information about the Spice-devel
mailing list