This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/6942] Unaligned access in resolv


------- 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]