[gtk/combos_not_scroll: 1/2] gdkkeys-win32: Fix uninitialized value
- From: Nelson Ben <nbenitez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/combos_not_scroll: 1/2] gdkkeys-win32: Fix uninitialized value
- Date: Fri, 21 Jan 2022 00:07:01 +0000 (UTC)
commit 10efc3cb0d8e30f4d7ac31da2cc904606a921ffe
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]