Files
bpfire/src/patches/glibc/glibc-rh1209375.patch
Michael Tremer 30ca037fb3 glibc: Fix CVE-2013-7423 and CVE-2015-1781
CVE-2013-7423: Fix invalid file descriptor reuse while sending DNS query
CVE-2015-1781: Fix buffer overflow in gethostbyname_r with misaligned buffer
2015-04-27 21:20:46 +02:00

19 lines
663 B
Diff

@@ -, +, @@
resolv/nss_dns/dns-host.c:getanswer_r.
---
resolv/nss_dns/dns-host.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/resolv/nss_dns/dns-host.c
+++ a/resolv/nss_dns/dns-host.c
@@ -615,7 +615,8 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype,
int have_to_map = 0;
uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct host_data);
buffer += pad;
- if (__builtin_expect (buflen < sizeof (struct host_data) + pad, 0))
+ buflen = buflen > pad ? buflen - pad : 0;
+ if (__builtin_expect (buflen < sizeof (struct host_data), 0))
{
/* The buffer is too small. */
too_small:
--