This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/6942] Unaligned access in resolv
- From: "schwab at suse dot de" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 7 Oct 2008 08:32:13 -0000
- Subject: [Bug libc/6942] Unaligned access in resolv
- References: <20081004174738.6942.hjl.tools@gmail.com>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From schwab at suse dot de 2008-10-07 08:32 -------
@@ -1050,8 +1058,16 @@ send_dg(res_state statp,
/* No buffer allocated for the first
reply. We can try to use the rest
of the user-provided buffer. */
+#ifdef _STRING_ARCH_unaligned
*anssizp2 = orig_anssizp - resplen;
*ansp2 = *ansp + resplen;
+#else
+ int aligned_resplen
+ = ((resplen + __alignof__ (HEADER) - 1)
+ & (__alignof__ (HEADER) - 1));
+ *anssizp2 = orig_anssizp - aligned_resplen;
+ *ansp2 = *ansp + aligned_resplen;
+#endif
} else {
/* The first reply did not fit into the
user-provided buffer. Maybe the second
--
http://sourceware.org/bugzilla/show_bug.cgi?id=6942
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.