Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-06-29 11:21:36 +0300
committerCampbell Barton <campbell@blender.org>2022-06-29 11:21:36 +0300
commit43b65150ed3853e6f40b0236b548393eb029c123 (patch)
tree728b571daacfd44ff0d02f0743e1f586b10440bf /source/blender/windowmanager
parent930398d5b18e59099d340d460c46840d643068b1 (diff)
Fix uninitialized memory use in key-down events on window activation
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/intern/wm_window.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index 3ea3ec2b70b..baf137e6665 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -1116,7 +1116,6 @@ static bool ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr C_void_pt
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));
@@ -1139,9 +1138,12 @@ static bool ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr C_void_pt
*
* 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;