bca718
commit 317b199b4aff8cfa27f2302ab404d2bb5032b9a4
bca718
Author: Florian Weimer <fweimer@redhat.com>
bca718
Date:   Tue Mar 29 12:57:56 2016 +0200
bca718
bca718
    CVE-2016-3075: Stack overflow in _nss_dns_getnetbyname_r [BZ #19879]
bca718
    
bca718
    The defensive copy is not needed because the name may not alias the
bca718
    output buffer.
bca718
bca718
diff --git a/resolv/nss_dns/dns-network.c b/resolv/nss_dns/dns-network.c
bca718
index 2eb2f67..8f301a7 100644
bca718
--- a/resolv/nss_dns/dns-network.c
bca718
+++ b/resolv/nss_dns/dns-network.c
bca718
@@ -118,17 +118,14 @@ _nss_dns_getnetbyname_r (const char *name, struct netent *result,
bca718
   } net_buffer;
bca718
   querybuf *orig_net_buffer;
bca718
   int anslen;
bca718
-  char *qbuf;
bca718
   enum nss_status status;
bca718
 
bca718
   if (__res_maybe_init (&_res, 0) == -1)
bca718
     return NSS_STATUS_UNAVAIL;
bca718
 
bca718
-  qbuf = strdupa (name);
bca718
-
bca718
   net_buffer.buf = orig_net_buffer = (querybuf *) alloca (1024);
bca718
 
bca718
-  anslen = __libc_res_nsearch (&_res, qbuf, C_IN, T_PTR, net_buffer.buf->buf,
bca718
+  anslen = __libc_res_nsearch (&_res, name, C_IN, T_PTR, net_buffer.buf->buf,
bca718
 			       1024, &net_buffer.ptr, NULL, NULL, NULL, NULL);
bca718
   if (anslen < 0)
bca718
     {