summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimmo Saan <simmo.saan@gmail.com>2016-10-20 23:24:50 +0300
committerSimmo Saan <simmo.saan@gmail.com>2016-10-20 23:24:50 +0300
commitbb22f2486b9a9cb392dc99ca08b8d746d385024d (patch)
tree2bbac020487f6ee2616c8af4816388792e558557
parentb51beb67663f85f137aaef77d2cfa611db2803ec (diff)
downloadweechat-bb22f2486b9a9cb392dc99ca08b8d746d385024d.zip
api: fix string_expand_home SIGSEGV when HOME environment variable unset
-rw-r--r--src/core/wee-string.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/core/wee-string.c b/src/core/wee-string.c
index f63d6f6f5..646d58722 100644
--- a/src/core/wee-string.c
+++ b/src/core/wee-string.c
@@ -503,6 +503,8 @@ string_expand_home (const char *path)
}
ptr_home = getenv ("HOME");
+ if (!ptr_home)
+ return NULL;
length = strlen (ptr_home) + strlen (path + 1) + 1;
str = malloc (length);