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

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