summaryrefslogtreecommitdiff
path: root/extra/kdebase-workspace/kdm-desktopnames.patch
blob: d6d6a961c3e2cfed39312306275fb5ee5e902535 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From: David Faure <faure@kde.org>
Date: Fri, 02 May 2014 08:26:38 +0000
Subject: Fix crash when DesktopNames isn't set
X-Git-Url: http://quickgit.kde.org/?p=kde-workspace.git&a=commitdiff&h=e1724800ecf3c6a7035dfa7bcaa50b2a8f48688f
---
Fix crash when DesktopNames isn't set

BUG: 334159
FIXED-IN: 4.11.10
---


--- a/kdm/backend/client.c
+++ b/kdm/backend/client.c
@@ -1810,12 +1810,14 @@
                             !(sessargs = iniEntry(str, "Desktop Entry", "Exec", 0)))
                         sessargs = "";
                     buf = iniEntry(str, "Desktop Entry", "DesktopNames", 0);
-                    for (buf2 = buf; *buf2; ++buf2) {
-                        if (*buf2 == ';')
-                            *buf2 = ':';
+                    if (buf) {
+                        for (buf2 = buf; *buf2; ++buf2) {
+                            if (*buf2 == ';')
+                                *buf2 = ':';
+                        }
+                        userEnviron = setEnv(userEnviron, "XDG_CURRENT_DESKTOP", buf);
+                        free(buf);
                     }
-                    userEnviron = setEnv(userEnviron, "XDG_CURRENT_DESKTOP", buf);
-                    free(buf);
                     free(str);
                     free(fname);
                     goto gotit;