arrfab / rpms / glibc

Forked from rpms/glibc 4 years ago
Clone

Blame SOURCES/glibc-rh1321993.patch

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