diff --git a/CHANGELOG b/CHANGELOG index 5113b94..b7aa3ca 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -78,6 +78,7 @@ xx/xx/2018 autofs-5.1.5 - fix missing initialization of autofs_point flags. - fix a regression with map instance lookup. - fix trailing dollar sun entry expansion. +- initialize struct addrinfo for getaddrinfo() calls. 19/12/2017 autofs-5.1.4 - fix spec file url. diff --git a/lib/parse_subs.c b/lib/parse_subs.c index cdda2e1..0ee00d5 100644 --- a/lib/parse_subs.c +++ b/lib/parse_subs.c @@ -475,6 +475,7 @@ unsigned int get_network_proximity(const char *name) hints.ai_socktype = SOCK_DGRAM; hints.ai_flags = AI_V4MAPPED | AI_ADDRCONFIG | AI_CANONNAME; + ni = NULL; ret = getaddrinfo(name_or_num, NULL, &hints, &ni); if (ret) { logerr("hostname lookup for %s failed: %s", diff --git a/lib/rpc_subs.c b/lib/rpc_subs.c index 8b23627..643b768 100644 --- a/lib/rpc_subs.c +++ b/lib/rpc_subs.c @@ -691,6 +691,7 @@ static int create_client(struct conn_info *info, CLIENT **client) else hints.ai_socktype = SOCK_STREAM; + ai = NULL; ret = getaddrinfo(info->host, NULL, &hints, &ai); if (ret) { error(LOGOPT_ANY, diff --git a/modules/dclist.c b/modules/dclist.c index ba32134..c34c3a9 100644 --- a/modules/dclist.c +++ b/modules/dclist.c @@ -355,6 +355,7 @@ static char *getdnsdomainname(unsigned int logopt) hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_DGRAM; + ni = NULL; ret = getaddrinfo(name, NULL, &hints, &ni); if (ret) { error(logopt, diff --git a/modules/parse_amd.c b/modules/parse_amd.c index 3aa58ab..d7c5540 100644 --- a/modules/parse_amd.c +++ b/modules/parse_amd.c @@ -269,6 +269,7 @@ static int match_my_name(struct autofs_point *ap, const char *name, struct subst hints.ai_socktype = SOCK_DGRAM; /* Get host canonical name */ + cni = NULL; ret = getaddrinfo(v->val, NULL, &hints, &cni); if (ret) { error(logopt, MODPREFIX @@ -280,6 +281,7 @@ static int match_my_name(struct autofs_point *ap, const char *name, struct subst hints.ai_flags = AI_V4MAPPED | AI_ADDRCONFIG | AI_CANONNAME; /* Resolve comparison name to its names and compare */ + ni = NULL; ret = getaddrinfo(exp_name, NULL, &hints, &ni); if (ret) { error(logopt, MODPREFIX @@ -775,6 +777,7 @@ static char *normalize_hostname(unsigned int logopt, const char *host, hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_DGRAM; + ni = NULL; ret = getaddrinfo(host, NULL, &hints, &ni); if (ret) { error(logopt, MODPREFIX diff --git a/modules/replicated.c b/modules/replicated.c index 740270e..cc8117a 100644 --- a/modules/replicated.c +++ b/modules/replicated.c @@ -985,6 +985,7 @@ static int add_host_addrs(struct host **list, const char *host, int ent_num, hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_DGRAM; + ni = NULL; ret = getaddrinfo(name, NULL, &hints, &ni); if (ret) goto try_name; @@ -1005,6 +1006,7 @@ try_name: hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_DGRAM; + ni = NULL; ret = getaddrinfo(name, NULL, &hints, &ni); if (ret) { error(LOGOPT_ANY,