Przeglądaj źródła

win-capture: Always set class/title/exe to null

When getting the class/title/exe of a particular window handle in the
build_window_strings function, always set the class/title/exe pointers
to null to prevent any potential references to invalid values if any of
them do not happen to be set for whatever reason.
jp9000 11 lat temu
rodzic
commit
7bf69e8a0a
1 zmienionych plików z 4 dodań i 3 usunięć
  1. 4 3
      plugins/win-capture/window-helpers.c

+ 4 - 3
plugins/win-capture/window-helpers.c

@@ -29,10 +29,11 @@ extern void build_window_strings(const char *str,
 {
 	char **strlist;
 
+	*class = NULL;
+	*title = NULL;
+	*exe   = NULL;
+
 	if (!str) {
-		*class = NULL;
-		*title = NULL;
-		*exe   = NULL;
 		return;
 	}