1
From 317b199b4aff8cfa27f2302ab404d2bb5032b9a4 Mon Sep 17 00:00:00 2001
2
From: Florian Weimer <fweimer@redhat.com>
3
Date: Tue, 29 Mar 2016 12:57:56 +0200
4
Subject: [PATCH] CVE-2016-3075: Stack overflow in _nss_dns_getnetbyname_r [BZ #19879]
6
The defensive copy is not needed because the name may not alias the
11
* resolv/nss_dns/dns-network.c (_nss_dns_getnetbyname_r): Do not
14
[Note: patch differs from upstream commit in that the entries in
15
the Changelog and NEWS were dropped to avoid patch conflicts. -- sbeattie]
17
resolv/nss_dns/dns-network.c | 5 +----
18
1 file changed, 1 insertion(+), 4 deletions(-)
20
Index: b/resolv/nss_dns/dns-network.c
21
===================================================================
22
--- a/resolv/nss_dns/dns-network.c
23
+++ b/resolv/nss_dns/dns-network.c
24
@@ -118,17 +118,14 @@ _nss_dns_getnetbyname_r (const char *nam
26
querybuf *orig_net_buffer;
29
enum nss_status status;
31
if (__res_maybe_init (&_res, 0) == -1)
32
return NSS_STATUS_UNAVAIL;
34
- qbuf = strdupa (name);
36
net_buffer.buf = orig_net_buffer = (querybuf *) alloca (1024);
38
- anslen = __libc_res_nsearch (&_res, qbuf, C_IN, T_PTR, net_buffer.buf->buf,
39
+ anslen = __libc_res_nsearch (&_res, name, C_IN, T_PTR, net_buffer.buf->buf,
40
1024, &net_buffer.ptr, NULL, NULL, NULL, NULL);