aboutsummaryrefslogtreecommitdiffstats
path: root/src/servers/kernel.c
diff options
context:
space:
mode:
authorAnton Kindestam <bountyjedi@gmail.com>2017-02-16 12:20:14 +0100
committerMattias Andrée <maandree@kth.se>2017-02-16 18:22:03 +0100
commitcbeeb4ccbf152e555868bfaa54a9b43fdd61f196 (patch)
tree7b23b4cffa2a3ac57357baad37d8fa95428ec62d /src/servers/kernel.c
parentFix man page (diff)
downloadcoopgammad-cbeeb4ccbf152e555868bfaa54a9b43fdd61f196.tar.gz
coopgammad-cbeeb4ccbf152e555868bfaa54a9b43fdd61f196.tar.bz2
coopgammad-cbeeb4ccbf152e555868bfaa54a9b43fdd61f196.tar.xz
Fix NULL-pointer bug in get_pathname when running with -mdrm1.2.2
Diffstat (limited to 'src/servers/kernel.c')
-rw-r--r--src/servers/kernel.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/servers/kernel.c b/src/servers/kernel.c
index 4ccbe9c..1600d0a 100644
--- a/src/servers/kernel.c
+++ b/src/servers/kernel.c
@@ -85,7 +85,7 @@ static char* get_pathname(const char* restrict suffix)
username = pw->pw_name ? pw->pw_name : "";
n = sizeof("/.coopgammad/~/.") + 3 * sizeof(int);
- n += strlen(rundir) + strlen(username) + strlen(name) + strlen(suffix);
+ n += strlen(rundir) + strlen(username) + ((name != NULL) ? strlen(name) : 0) + strlen(suffix);
if (!(rc = malloc(n)))
goto fail;
sprintf(rc, "%s/.coopgammad/~%s/%i%s%s%s",