]> sourceware.org Git - glibc.git/commitdiff
* resolv/res_init.c (__res_vinit): Always assign to statp->nscount
authorUlrich Drepper <drepper@redhat.com>
Mon, 8 Dec 2008 03:59:18 +0000 (03:59 +0000)
committerUlrich Drepper <drepper@redhat.com>
Mon, 8 Dec 2008 03:59:18 +0000 (03:59 +0000)
after reading name server list.

ChangeLog
nis/nss_nis/nis-hosts.c
resolv/res_init.c

index 5c752d11bf52ed7cfad52361a23348e0fade2e0d..18934f1aa7856a22392a6d604e1999e51bf7ecf6 100644 (file)
--- 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.
 
index 8accf53edf634253e3a0cb712228d7569e1d0c77..e1db5f531ff13c2e44812bf697659172afd065f6 100644 (file)
@@ -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);
 
index 0cdd55e71b05db2f4641357b68d98433fb2ff1e8..670ad23c2290aefe6594d3e564b31c3cf012fc4d 100644 (file)
@@ -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;
This page took 0.048681 seconds and 5 git commands to generate.