From f333ede1f74e54eb20c9485f1a4033ca54eff3fc Mon Sep 17 00:00:00 2001 From: NBonaparte Date: Sun, 31 Oct 2021 22:13:29 -0700 Subject: [PATCH] fix: check if `processName` is NULL/empty to prevent segfaults --- src/common/detectWMDE.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/common/detectWMDE.c b/src/common/detectWMDE.c index e30909aa4..f03144adc 100644 --- a/src/common/detectWMDE.c +++ b/src/common/detectWMDE.c @@ -66,6 +66,9 @@ static void getSessionDesktop(FFWMDEResult* result) static void applyPrettyNameIfWM(FFWMDEResult* result, const char* processName, ProtocolHint* protocolHint) { + if(processName == NULL || *processName == '\0') + return; + if(strcasecmp(processName, "kwin_wayland") == 0) { ffStrbufSetS(&result->wmPrettyName, "KWin");