aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2008-12-08 03:59:18 +0000
committerUlrich Drepper <drepper@redhat.com>2008-12-08 03:59:18 +0000
commit905ef0daeb2fa3d685d924cdd8cbd6a4b19df8b8 (patch)
treec92b3ef3b1da17def65b34fd3b0e92a6f9b0380c
parente87946cce5b1bac5105f97542c93bc3101bde254 (diff)
downloadglibc-905ef0daeb2fa3d685d924cdd8cbd6a4b19df8b8.tar
glibc-905ef0daeb2fa3d685d924cdd8cbd6a4b19df8b8.tar.gz
glibc-905ef0daeb2fa3d685d924cdd8cbd6a4b19df8b8.tar.bz2
glibc-905ef0daeb2fa3d685d924cdd8cbd6a4b19df8b8.zip
* resolv/res_init.c (__res_vinit): Always assign to statp->nscount
after reading name server list.
-rw-r--r--ChangeLog3
-rw-r--r--nis/nss_nis/nis-hosts.c3
-rw-r--r--resolv/res_init.c3
3 files changed, 5 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 5c752d11bf..18934f1aa7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2008-12-07 Ulrich Drepper <drepper@redhat.com>
+ * resolv/res_init.c (__res_vinit): Always assign to statp->nscount
+ after reading name server list.
+
* nis/nss_nis/nis-hosts.c (_nss_nis_gethostbyname4_r): Fix memory
handling for host name aliases.
diff --git a/nis/nss_nis/nis-hosts.c b/nis/nss_nis/nis-hosts.c
index 8accf53edf..e1db5f531f 100644
--- a/nis/nss_nis/nis-hosts.c
+++ b/nis/nss_nis/nis-hosts.c
@@ -545,8 +545,7 @@ _nss_nis_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat,
size_t h_name_len = strlen (host.h_name) + 1;
if (h_name_len >= buflen)
goto erange;
- /* Potentially the string and the destination buffer overlap. */
- (*pat)->name = memmove (buffer, host.h_name, h_name_len);
+ (*pat)->name = memcpy (buffer, host.h_name, h_name_len);
free (result);
diff --git a/resolv/res_init.c b/resolv/res_init.c
index 0cdd55e71b..670ad23c22 100644
--- a/resolv/res_init.c
+++ b/resolv/res_init.c
@@ -420,8 +420,7 @@ __res_vinit(res_state statp, int preinit) {
continue;
}
}
- if (nserv > 1)
- statp->nscount = nserv;
+ statp->nscount = nserv;
#ifdef _LIBC
if (nservall - nserv > 0) {
statp->_u._ext.nscount6 = nservall - nserv;