public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* Fix unaligned access
@ 2005-07-13 11:21 Andreas Schwab
  2005-07-13 14:25 ` Ulrich Drepper
  0 siblings, 1 reply; 9+ messages in thread
From: Andreas Schwab @ 2005-07-13 11:21 UTC (permalink / raw)
  To: libc-hacker

This fixes an unaligned access during nscd communication.

Andreas.

2005-07-13  Andreas Schwab  <schwab@suse.de>

	* nscd/nscd_helper.c (get_mapping): Align control message buffer.

--- nscd/nscd_helper.c.~1.10.~	2005-02-23 11:25:53.000000000 +0100
+++ nscd/nscd_helper.c	2005-07-13 11:54:38.000000000 +0200
@@ -176,7 +176,7 @@ get_mapping (request_type type, const ch
   iov[0].iov_base = resdata;
   iov[0].iov_len = keylen;
 
-  char buf[CMSG_SPACE (sizeof (int))];
+  char buf[CMSG_SPACE (sizeof (int))] __attribute__ ((aligned));
   struct msghdr msg = { .msg_iov = iov, .msg_iovlen = 1,
 			.msg_control = buf, .msg_controllen = sizeof (buf) };
   struct cmsghdr *cmsg = CMSG_FIRSTHDR (&msg);

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2005-07-14 15:34 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-13 11:21 Fix unaligned access Andreas Schwab
2005-07-13 14:25 ` Ulrich Drepper
2005-07-13 15:01   ` Andreas Schwab
2005-07-13 22:55     ` Ulrich Drepper
2005-07-14  7:56       ` Andreas Schwab
2005-07-14  7:59         ` Ulrich Drepper
2005-07-14  8:55           ` Andreas Schwab
2005-07-14 14:54             ` Ulrich Drepper
2005-07-14 15:34               ` Andreas Schwab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).