about summary refs log tree commit diff
path: root/nscd/nscd_gethst_r.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-07-09 20:58:54 +0000
committerUlrich Drepper <drepper@redhat.com>1999-07-09 20:58:54 +0000
commitc2fa5b5a4f4d2f0f71918f4cd8b5b67a26d4b72c (patch)
tree3682f88638ed44e98e8c0d0c284d209d822b1804 /nscd/nscd_gethst_r.c
parenta828c2f5332fbee41968ccc57115d0d8fc105b85 (diff)
downloadglibc-c2fa5b5a4f4d2f0f71918f4cd8b5b67a26d4b72c.tar.gz
glibc-c2fa5b5a4f4d2f0f71918f4cd8b5b67a26d4b72c.tar.xz
glibc-c2fa5b5a4f4d2f0f71918f4cd8b5b67a26d4b72c.zip
Update.
1999-07-09  Cristian Gafton  <gafton@redhat.com>

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