Fix unaligned access
Andreas Schwab
schwab@suse.de
Wed Jul 13 11:21:00 GMT 2005
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."
More information about the Libc-hacker
mailing list