From 30e94b6a5cb295de1d5b0ff6b066711b98b1c95f Mon Sep 17 00:00:00 2001 From: Owen Dunn Date: Tue, 7 Dec 2004 11:50:44 +0000 Subject: [PATCH] Fix segfault when HOME not set on Unix. [originally from svn r4948] --- unix/uxstore.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/unix/uxstore.c b/unix/uxstore.c index c46b9a29..85d72ca7 100644 --- a/unix/uxstore.c +++ b/unix/uxstore.c @@ -85,6 +85,8 @@ static void make_filename(char *filename, int index, const char *subname) char *home; int len; home = getenv("HOME"); + if (!home) + home="/"; strncpy(filename, home, FILENAME_MAX); len = strlen(filename); if (index == INDEX_SESSION) {