Blame SOURCES/autofs-5.1.6-initialize-struct-addrinfo-for-getaddrinfo-calls.patch

81b4ce
autofs-5.1.6 - initialize struct addrinfo for getaddrinfo() calls
81b4ce
81b4ce
From: Ian Kent <raven@themaw.net>
81b4ce
81b4ce
The getaddrinfo() call may have become more fussy about initialization
81b4ce
of the passed in struct addrinfo that receives the results.
81b4ce
81b4ce
It's good practice to initialize it prior to the gataddrinfo() call just
81b4ce
in case.
81b4ce
81b4ce
Signed-off-by: Ian Kent <raven@themaw.net>
81b4ce
---
81b4ce
 CHANGELOG            |    1 +
81b4ce
 lib/parse_subs.c     |    1 +
81b4ce
 lib/rpc_subs.c       |    1 +
81b4ce
 modules/dclist.c     |    1 +
81b4ce
 modules/parse_amd.c  |    3 +++
81b4ce
 modules/replicated.c |    2 ++
81b4ce
 6 files changed, 9 insertions(+)
81b4ce
81b4ce
--- autofs-5.1.4.orig/CHANGELOG
81b4ce
+++ autofs-5.1.4/CHANGELOG
81b4ce
@@ -78,6 +78,7 @@ xx/xx/2018 autofs-5.1.5
81b4ce
 - fix missing initialization of autofs_point flags.
81b4ce
 - fix a regression with map instance lookup.
81b4ce
 - fix trailing dollar sun entry expansion.
81b4ce
+- initialize struct addrinfo for getaddrinfo() calls.
81b4ce
 
81b4ce
 19/12/2017 autofs-5.1.4
81b4ce
 - fix spec file url.
81b4ce
--- autofs-5.1.4.orig/lib/parse_subs.c
81b4ce
+++ autofs-5.1.4/lib/parse_subs.c
81b4ce
@@ -475,6 +475,7 @@ unsigned int get_network_proximity(const
81b4ce
 	hints.ai_socktype = SOCK_DGRAM;
81b4ce
 	hints.ai_flags = AI_V4MAPPED | AI_ADDRCONFIG | AI_CANONNAME;
81b4ce
 
81b4ce
+	ni = NULL;
81b4ce
 	ret = getaddrinfo(name_or_num, NULL, &hints, &ni);
81b4ce
 	if (ret) {
81b4ce
 		logerr("hostname lookup for %s failed: %s",
81b4ce
--- autofs-5.1.4.orig/lib/rpc_subs.c
81b4ce
+++ autofs-5.1.4/lib/rpc_subs.c
81b4ce
@@ -691,6 +691,7 @@ static int create_client(struct conn_inf
81b4ce
 	else
81b4ce
 		hints.ai_socktype = SOCK_STREAM;
81b4ce
 
81b4ce
+	ai = NULL;
81b4ce
 	ret = getaddrinfo(info->host, NULL, &hints, &ai;;
81b4ce
 	if (ret) {
81b4ce
 		error(LOGOPT_ANY,
81b4ce
--- autofs-5.1.4.orig/modules/dclist.c
81b4ce
+++ autofs-5.1.4/modules/dclist.c
81b4ce
@@ -355,6 +355,7 @@ static char *getdnsdomainname(unsigned i
81b4ce
 	hints.ai_family = AF_UNSPEC;
81b4ce
 	hints.ai_socktype = SOCK_DGRAM;
81b4ce
 
81b4ce
+	ni = NULL;
81b4ce
 	ret = getaddrinfo(name, NULL, &hints, &ni);
81b4ce
 	if (ret) {
81b4ce
 		error(logopt,
81b4ce
--- autofs-5.1.4.orig/modules/parse_amd.c
81b4ce
+++ autofs-5.1.4/modules/parse_amd.c
81b4ce
@@ -269,6 +269,7 @@ static int match_my_name(struct autofs_p
81b4ce
 	hints.ai_socktype = SOCK_DGRAM;
81b4ce
 
81b4ce
 	/* Get host canonical name */
81b4ce
+	cni = NULL;
81b4ce
 	ret = getaddrinfo(v->val, NULL, &hints, &cni);
81b4ce
 	if (ret) {
81b4ce
 		error(logopt, MODPREFIX
81b4ce
@@ -280,6 +281,7 @@ static int match_my_name(struct autofs_p
81b4ce
 	hints.ai_flags = AI_V4MAPPED | AI_ADDRCONFIG | AI_CANONNAME;
81b4ce
 
81b4ce
 	/* Resolve comparison name to its names and compare */
81b4ce
+	ni = NULL;
81b4ce
 	ret = getaddrinfo(exp_name, NULL, &hints, &ni);
81b4ce
 	if (ret) {
81b4ce
 		error(logopt, MODPREFIX
81b4ce
@@ -775,6 +777,7 @@ static char *normalize_hostname(unsigned
81b4ce
 		hints.ai_family = AF_UNSPEC;
81b4ce
 		hints.ai_socktype = SOCK_DGRAM;
81b4ce
 
81b4ce
+		ni = NULL;
81b4ce
 		ret = getaddrinfo(host, NULL, &hints, &ni);
81b4ce
 		if (ret) {
81b4ce
 			error(logopt, MODPREFIX
81b4ce
--- autofs-5.1.4.orig/modules/replicated.c
81b4ce
+++ autofs-5.1.4/modules/replicated.c
81b4ce
@@ -985,6 +985,7 @@ static int add_host_addrs(struct host **
81b4ce
 	hints.ai_family = AF_UNSPEC;
81b4ce
 	hints.ai_socktype = SOCK_DGRAM;
81b4ce
 
81b4ce
+	ni = NULL;
81b4ce
 	ret = getaddrinfo(name, NULL, &hints, &ni);
81b4ce
 	if (ret)
81b4ce
 		goto try_name;
81b4ce
@@ -1005,6 +1006,7 @@ try_name:
81b4ce
 	hints.ai_family = AF_UNSPEC;
81b4ce
 	hints.ai_socktype = SOCK_DGRAM;
81b4ce
 
81b4ce
+	ni = NULL;
81b4ce
 	ret = getaddrinfo(name, NULL, &hints, &ni);
81b4ce
 	if (ret) {
81b4ce
 		error(LOGOPT_ANY,