spice-gtk/0013-vnc-keymap-fix-incorrect-table-size.patch
2012-10-25 18:11:18 +02:00

36 lines
1.2 KiB
Diff

From c3572d4889962f16b720f029e4b68fa29d84b84f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@redhat.com>
Date: Mon, 15 Oct 2012 18:42:16 +0200
Subject: [PATCH 13/21] vnc keymap: fix incorrect table size
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
--
1.7.12.1