about summary refs log tree commit diff
path: root/nscd/nscd_gethst_r.c
diff options
context:
space:
mode:
Diffstat (limited to 'nscd/nscd_gethst_r.c')
-rw-r--r--nscd/nscd_gethst_r.c6
1 files changed, 6 insertions, 0 deletions
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;