Browse Source

Merge pull request #27815 from Faless/unix/mem_access

Fix jump over uninitialized value in OS Unix/X11
Hein-Pieter van Braam 6 years ago
parent
commit
f75b9e6246
2 changed files with 3 additions and 0 deletions
  1. 1 0
      drivers/unix/os_unix.cpp
  2. 2 0
      platform/x11/os_x11.cpp

+ 1 - 0
drivers/unix/os_unix.cpp

@@ -108,6 +108,7 @@ void OS_Unix::initialize_debugging() {
 
 
 	if (ScriptDebugger::get_singleton() != NULL) {
 	if (ScriptDebugger::get_singleton() != NULL) {
 		struct sigaction action;
 		struct sigaction action;
+		memset(&action, 0, sizeof(action));
 		action.sa_handler = handle_interrupt;
 		action.sa_handler = handle_interrupt;
 		sigaction(SIGINT, &action, NULL);
 		sigaction(SIGINT, &action, NULL);
 	}
 	}

+ 2 - 0
platform/x11/os_x11.cpp

@@ -3238,6 +3238,8 @@ OS_X11::OS_X11() {
 	AudioDriverManager::add_driver(&driver_alsa);
 	AudioDriverManager::add_driver(&driver_alsa);
 #endif
 #endif
 
 
+	xi.opcode = 0;
+	xi.last_relative_time = 0;
 	layered_window = false;
 	layered_window = false;
 	minimized = false;
 	minimized = false;
 	xim_style = 0L;
 	xim_style = 0L;