Blame SOURCES/glibc-rh1199525.patch

147e83
commit 2959eda9272a033863c271aff62095abd01bd4e3
147e83
Author: Arjun Shankar <arjun.is@lostca.se>
147e83
Date:   Tue Apr 21 14:06:31 2015 +0200
147e83
147e83
    CVE-2015-1781: resolv/nss_dns/dns-host.c buffer overflow [BZ#18287]
147e83
147e83
diff --git glibc-2.17-c758a686/resolv/nss_dns/dns-host.c glibc-2.17-c758a686/resolv/nss_dns/dns-host.c
147e83
index b16b0dd..d8c5579 100644
147e83
--- glibc-2.17-c758a686/resolv/nss_dns/dns-host.c
147e83
+++ glibc-2.17-c758a686/resolv/nss_dns/dns-host.c
147e83
@@ -613,7 +613,8 @@
147e83
   int have_to_map = 0;
147e83
   uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct host_data);
147e83
   buffer += pad;
147e83
-  if (__builtin_expect (buflen < sizeof (struct host_data) + pad, 0))
147e83
+  buflen = buflen > pad ? buflen - pad : 0;
147e83
+  if (__builtin_expect (buflen < sizeof (struct host_data), 0))
147e83
     {
147e83
       /* The buffer is too small.  */
147e83
     too_small: