[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

r2079 - in glibc-package/trunk/debian: . patches patches/any



Author: aurel32
Date: 2007-04-16 20:49:40 +0000 (Mon, 16 Apr 2007)
New Revision: 2079

Added:
   glibc-package/trunk/debian/patches/any/submitted-gethostbyname_r.diff
Modified:
   glibc-package/trunk/debian/changelog
   glibc-package/trunk/debian/patches/series
Log:
  * patches/any/submitted-gethostbyname_r.diff: new patch to fix unaligned
    memory access in gethostbyname_r.diff().  Closes: #419459.


Modified: glibc-package/trunk/debian/changelog
===================================================================
--- glibc-package/trunk/debian/changelog	2007-04-16 00:03:20 UTC (rev 2078)
+++ glibc-package/trunk/debian/changelog	2007-04-16 20:49:40 UTC (rev 2079)
@@ -13,8 +13,10 @@
   * Switch from gzip to lzma for compressing the locales in the locales-all
     package. The unpacked size is decreased by 10 and the packed size by 4 for
     no measurable difference on the unpacking time.
+  * patches/any/submitted-gethostbyname_r.diff: new patch to fix unaligned
+    memory access in gethostbyname_r.diff().  Closes: #419459.
 
- -- Aurelien Jarno <aurel32@debian.org>  Mon, 16 Apr 2007 01:34:18 +0200
+ -- Aurelien Jarno <aurel32@debian.org>  Mon, 16 Apr 2007 22:35:26 +0200
 
 glibc (2.5-2) unstable; urgency=low
 

Added: glibc-package/trunk/debian/patches/any/submitted-gethostbyname_r.diff
===================================================================
--- glibc-package/trunk/debian/patches/any/submitted-gethostbyname_r.diff	2007-04-16 00:03:20 UTC (rev 2078)
+++ glibc-package/trunk/debian/patches/any/submitted-gethostbyname_r.diff	2007-04-16 20:49:40 UTC (rev 2079)
@@ -0,0 +1,32 @@
+--- resolv/nss_dns/dns-host.c.orig	2007-04-16 00:13:12.000000000 +0200
++++ resolv/nss_dns/dns-host.c	2007-04-16 00:34:41.000000000 +0200
+@@ -78,6 +78,7 @@
+ #include <stdlib.h>
+ #include <stddef.h>
+ #include <string.h>
++#include <obstack.h>
+ #include <sys/syslog.h>
+ 
+ #include "nsswitch.h"
+@@ -465,8 +466,8 @@
+     char *aliases[MAX_NR_ALIASES];
+     unsigned char host_addr[16];	/* IPv4 or IPv6 */
+     char *h_addr_ptrs[0];
+-  } *host_data = (struct host_data *) buffer;
+-  int linebuflen = buflen - sizeof (struct host_data);
++  } *host_data;
++  int linebuflen;
+   register const HEADER *hp;
+   const u_char *end_of_message, *cp;
+   int n, ancount, qdcount;
+@@ -479,6 +480,10 @@
+   int have_to_map = 0;
+   int32_t ttl = 0;
+ 
++  /* Align the buffer. */
++  host_data = (struct host_data *) __PTR_ALIGN(0, buffer, sizeof(char*) - 1);
++  linebuflen = buflen - sizeof (struct host_data) - ((char *)host_data - buffer);
++
+   if (__builtin_expect (linebuflen, 0) < 0)
+     {
+       /* The buffer is too small.  */

Modified: glibc-package/trunk/debian/patches/series
===================================================================
--- glibc-package/trunk/debian/patches/series	2007-04-16 00:03:20 UTC (rev 2078)
+++ glibc-package/trunk/debian/patches/series	2007-04-16 20:49:40 UTC (rev 2079)
@@ -137,5 +137,6 @@
 any/submitted-getcwd-sys_param_h.diff -p0
 any/submitted-clock-settime.diff -p0
 any/submitted-date-and-unknown-tz.diff -p0
+any/submitted-gethostbyname_r.diff -p0
 any/submitted-unistd_XOPEN_VERSION.diff
 any/cvs-glob-c.diff



Reply to: