The following commit has been merged in the master branch: commit 0be7e1d2743b789db425f8910c45c50b4a8cc7f1 Author: Marek Lindner lindner_marek@yahoo.de Date: Thu Sep 16 15:13:12 2010 +0200
batctl: fix crash if HOME environment variable is not set
Signed-off-by: Marek Lindner lindner_marek@yahoo.de
diff --git a/bat-hosts.c b/bat-hosts.c index 8948892..5802e80 100644 --- a/bat-hosts.c +++ b/bat-hosts.c @@ -181,6 +181,9 @@ void bat_hosts_init(void)
if (strlen(bat_hosts_path[i]) >= 2 && bat_hosts_path[i][0] == '~' && bat_hosts_path[i][1] == '/') { + if (!homedir) + continue; + strncpy(confdir, homedir, CONF_DIR_LEN); confdir[CONF_DIR_LEN - 1] = '\0'; strncat(confdir, &bat_hosts_path[i][1], CONF_DIR_LEN - strlen(confdir));