[commits] batctl; branch, next, updated. v2010.1.0-8-gb099a12

postmaster at open-mesh.org postmaster at open-mesh.org
Thu Sep 16 17:19:32 CEST 2010


The following commit has been merged in the next branch:
commit b099a1286065e90a536da1f3e257dccb3b93ad42
Author: Marek Lindner <lindner_marek at 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 at 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));

-- 
batctl


More information about the commits mailing list