Merge pull request #827 from sim642/string_expand_home-sigsegv

api: fix string_expand_home SIGSEGV when HOME environment variable unset
This commit is contained in:
Sébastien Helleu 2016-10-30 07:02:55 +01:00 committed by GitHub
commit 75a07fb2a3

View File

@ -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);