- Support an arbitrary number of search domains (#168253) - Detect and apply /etc/resolv.conf changes in libresolv (#1374239) - CVE-2015-5180: DNS stub resolver crash with crafted record type (#1251403)
40 lines
1.3 KiB
Diff
40 lines
1.3 KiB
Diff
commit 6257fcfd58479f6b7ae0fdde045b9ff144d543da
|
|
Author: Florian Weimer <fweimer@redhat.com>
|
|
Date: Fri Jun 2 16:35:13 2017 +0200
|
|
|
|
getaddrinfo: Fix localplt failure involving strdup
|
|
|
|
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
|
|
index daa742c260e667a7..0e92221853dd73b1 100644
|
|
--- a/sysdeps/posix/getaddrinfo.c
|
|
+++ b/sysdeps/posix/getaddrinfo.c
|
|
@@ -286,9 +286,16 @@ convert_hostent_to_gaih_addrtuple (const struct addrinfo *req,
|
|
} \
|
|
*pat = addrmem; \
|
|
\
|
|
- if (localcanon != NULL && canon == NULL) \
|
|
- canon = strdupa (localcanon); \
|
|
- \
|
|
+ if (localcanon != NULL && canon == NULL) \
|
|
+ { \
|
|
+ canonbuf = __strdup (localcanon); \
|
|
+ if (canonbuf == NULL) \
|
|
+ { \
|
|
+ result = -EAI_SYSTEM; \
|
|
+ goto free_and_return; \
|
|
+ } \
|
|
+ canon = canonbuf; \
|
|
+ } \
|
|
if (_family == AF_INET6 && *pat != NULL) \
|
|
got_ipv6 = true; \
|
|
} \
|
|
@@ -330,7 +337,7 @@ getcanonname (service_user *nip, struct gaih_addrtuple *at, const char *name)
|
|
string. */
|
|
s = (char *) name;
|
|
}
|
|
- return strdup (name);
|
|
+ return __strdup (name);
|
|
}
|
|
|
|
static int
|