From c2fa5b5a4f4d2f0f71918f4cd8b5b67a26d4b72c Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 9 Jul 1999 20:58:54 +0000 Subject: Update. 1999-07-09 Cristian Gafton * nscd/nscd_gethst_r.c (nscd_gethst_r): Make sure resultbuf->h_addr_list addresses are correctly aligned. * sysdeps/i386/bits/string.h (__memcpy_c): Help some stupid old compilers. (__memset_cc): Likewise. --- nscd/nscd_gethst_r.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'nscd/nscd_gethst_r.c') diff --git a/nscd/nscd_gethst_r.c b/nscd/nscd_gethst_r.c index cb8f62e696..6ee0826e98 100644 --- a/nscd/nscd_gethst_r.c +++ b/nscd/nscd_gethst_r.c @@ -214,6 +214,12 @@ nscd_gethst_r (const char *key, size_t keylen, request_type type, + hst_resp.h_aliases_cnt * sizeof (size_t)); n = 2; + + /* These things must be aligned or ntohl will cause havoc. */ + align = ((__alignof__ (char *) - (cp - ((char *) 0))) + & (__alignof__ (char *) - 1)); + cp += align; + if (type == GETHOSTBYADDR || type == GETHOSTBYNAME) { vec[2].iov_base = cp; -- cgit v1.2.3