autofs/SOURCES/autofs-5.1.6-initialize-struct-addrinfo-for-getaddrinfo-calls.patch
2021-09-09 14:55:10 +00:00

105 lines
3.1 KiB
Diff

autofs-5.1.6 - initialize struct addrinfo for getaddrinfo() calls
From: Ian Kent <raven@themaw.net>
The getaddrinfo() call may have become more fussy about initialization
of the passed in struct addrinfo that receives the results.
It's good practice to initialize it prior to the gataddrinfo() call just
in case.
Signed-off-by: Ian Kent <raven@themaw.net>
---
CHANGELOG | 1 +
lib/parse_subs.c | 1 +
lib/rpc_subs.c | 1 +
modules/dclist.c | 1 +
modules/parse_amd.c | 3 +++
modules/replicated.c | 2 ++
6 files changed, 9 insertions(+)
--- autofs-5.1.4.orig/CHANGELOG
+++ autofs-5.1.4/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.
--- autofs-5.1.4.orig/lib/parse_subs.c
+++ autofs-5.1.4/lib/parse_subs.c
@@ -475,6 +475,7 @@ unsigned int get_network_proximity(const
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",
--- autofs-5.1.4.orig/lib/rpc_subs.c
+++ autofs-5.1.4/lib/rpc_subs.c
@@ -691,6 +691,7 @@ static int create_client(struct conn_inf
else
hints.ai_socktype = SOCK_STREAM;
+ ai = NULL;
ret = getaddrinfo(info->host, NULL, &hints, &ai);
if (ret) {
error(LOGOPT_ANY,
--- autofs-5.1.4.orig/modules/dclist.c
+++ autofs-5.1.4/modules/dclist.c
@@ -355,6 +355,7 @@ static char *getdnsdomainname(unsigned i
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_DGRAM;
+ ni = NULL;
ret = getaddrinfo(name, NULL, &hints, &ni);
if (ret) {
error(logopt,
--- autofs-5.1.4.orig/modules/parse_amd.c
+++ autofs-5.1.4/modules/parse_amd.c
@@ -269,6 +269,7 @@ static int match_my_name(struct autofs_p
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_p
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
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_DGRAM;
+ ni = NULL;
ret = getaddrinfo(host, NULL, &hints, &ni);
if (ret) {
error(logopt, MODPREFIX
--- autofs-5.1.4.orig/modules/replicated.c
+++ autofs-5.1.4/modules/replicated.c
@@ -985,6 +985,7 @@ static int add_host_addrs(struct host **
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,