From 7bf69e8a0acdd65645e82cdaf85cebb986fc727d Mon Sep 17 00:00:00 2001 From: jp9000 Date: Mon, 10 Nov 2014 01:18:28 -0800 Subject: [PATCH] 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. --- plugins/win-capture/window-helpers.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/win-capture/window-helpers.c b/plugins/win-capture/window-helpers.c index 0e152db21..ebd3ce2db 100644 --- a/plugins/win-capture/window-helpers.c +++ b/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; }