[Bf-blender-cvs] [45763272c55] blender-v3.2-release: Fix uninitialized memory use in key-down events on window activation

Campbell Barton noreply at git.blender.org
Wed Jun 29 16:21:51 CEST 2022


Commit: 45763272c55a9125947da19aba096939ea8a36f9
Author: Campbell Barton
Date:   Wed Jun 29 18:21:36 2022 +1000
Branches: blender-v3.2-release
https://developer.blender.org/rB45763272c55a9125947da19aba096939ea8a36f9

Fix uninitialized memory use in key-down events on window activation

===================================================================

M	source/blender/windowmanager/intern/wm_window.c

===================================================================

diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index c0427f9be9a..275fc818c89 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -1115,7 +1115,6 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr C_void_ptr
 
         break;
       case GHOST_kEventWindowActivate: {
-        GHOST_TEventKeyData kdata;
         const int keymodifier = ((query_qual(SHIFT) ? KM_SHIFT : 0) |
                                  (query_qual(CONTROL) ? KM_CTRL : 0) |
                                  (query_qual(ALT) ? KM_ALT : 0) | (query_qual(OS) ? KM_OSKEY : 0));
@@ -1138,9 +1137,12 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr C_void_ptr
          *
          * For now don't send GHOST_kEventKeyDown events, just set the 'eventstate'.
          */
-        kdata.ascii = '\0';
-        kdata.utf8_buf[0] = '\0';
-
+        GHOST_TEventKeyData kdata = {
+            .key = GHOST_kKeyUnknown,
+            .ascii = '\0',
+            .utf8_buf = {'\0'},
+            .is_repeat = false,
+        };
         if (win->eventstate->modifier & KM_SHIFT) {
           if ((keymodifier & KM_SHIFT) == 0) {
             kdata.key = GHOST_kKeyLeftShift;



More information about the Bf-blender-cvs mailing list