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

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