[gtk/gtk-3-24: 1/2] gdkkeys-win32: Fix uninitialized value




commit f81da43b0097693e7e86ec5e3cc5673b2859bdcf
Author: Philip Zander <philip zander gmail com>
Date:   Fri Jan 7 20:48:50 2022 +0100

    gdkkeys-win32: Fix uninitialized value
    
    gdk_win32_keymap_get_entries_for_keycode() did not initialize n_entries,
    which led to a wrong number of items being returned in some cases.
    
    /fixes #4610

 gdk/win32/gdkkeys-win32.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/gdk/win32/gdkkeys-win32.c b/gdk/win32/gdkkeys-win32.c
index 1a1e730026..18a6752278 100644
--- a/gdk/win32/gdkkeys-win32.c
+++ b/gdk/win32/gdkkeys-win32.c
@@ -870,6 +870,8 @@ gdk_win32_keymap_get_entries_for_keycode (GdkKeymap     *gdk_keymap,
   g_return_val_if_fail (GDK_IS_KEYMAP (gdk_keymap), FALSE);
   g_return_val_if_fail (n_entries != NULL, FALSE);
 
+  *n_entries = 0;
+
   if (keys != NULL)
     key_array = g_array_new (FALSE, FALSE, sizeof (GdkKeymapKey));
   else


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