File: mayhem-segfault.patch

package info (click to toggle)
amoebax 0.2.1%2Bdfsg-7
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 12,976 kB
  • sloc: cpp: 14,521; sh: 3,739; makefile: 450; objc: 157; ansic: 99
file content (34 lines) | stat: -rw-r--r-- 1,118 bytes parent folder | download | duplicates (5)
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
From: Markus Koschany <apo@debian.org>
Date: Mon, 28 Apr 2014 22:55:19 +0200
Subject: mayhem segfault

Bug: https://bugs.debian.org/715632
Forwarded: no
---
 src/UnixOptions.cxx | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/UnixOptions.cxx b/src/UnixOptions.cxx
index 0ffa7ac..7e85937 100644
--- a/src/UnixOptions.cxx
+++ b/src/UnixOptions.cxx
@@ -125,12 +125,16 @@ UnixOptions::getOptionsDirectory (void)
 #if defined (IS_GP2X_HOST)
     return std::string (".");
 #else // IS_GP2X_HOST
-    char *configHome = getenv ("XDG_CONFIG_HOME");
+    const char* configHome = getenv ("XDG_CONFIG_HOME");
     std::string configDirectory (NULL == configHome ? "" : configHome);
     if ( 0 == configDirectory.length () )
     {
-        configDirectory += getenv ("HOME");
-        configDirectory += "/.config";
+        const char* configHome = getenv ("HOME");
+        if (configHome != NULL)
+        {
+            configDirectory += configHome;
+            configDirectory += "/.config";
+        }
     }
     configDirectory += "/amoebax";
     makeDirectory (configDirectory);