summaryrefslogtreecommitdiff
path: root/lib/libc/net
diff options
context:
space:
mode:
authortron <tron@NetBSD.org>2000-05-23 07:03:10 +0000
committertron <tron@NetBSD.org>2000-05-23 07:03:10 +0000
commitb4969ca513cdfd6aead8a3b52be6eb78217596bf (patch)
tree59dd9c507616d0b686447d661082948f42aeeb61 /lib/libc/net
parentc02ef5cc856e74fe317a92db82076bda6b4f4909 (diff)
Fix an alignment problem introduced by the patch for PR lib/8032.
Fixes PR lib/10048 by J.T. Conklin.
Diffstat (limited to 'lib/libc/net')
-rw-r--r--lib/libc/net/gethnamaddr.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libc/net/gethnamaddr.c b/lib/libc/net/gethnamaddr.c
index 972d9d63468..fab95fac3fd 100644
--- a/lib/libc/net/gethnamaddr.c
+++ b/lib/libc/net/gethnamaddr.c
@@ -1,4 +1,4 @@
-/* $NetBSD: gethnamaddr.c,v 1.32 2000/04/25 13:47:38 itojun Exp $ */
+/* $NetBSD: gethnamaddr.c,v 1.33 2000/05/23 07:03:10 tron Exp $ */
/*
* ++Copyright++ 1985, 1988, 1993
@@ -61,7 +61,7 @@
static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93";
static char rcsid[] = "Id: gethnamaddr.c,v 8.21 1997/06/01 20:34:37 vixie Exp ";
#else
-__RCSID("$NetBSD: gethnamaddr.c,v 1.32 2000/04/25 13:47:38 itojun Exp $");
+__RCSID("$NetBSD: gethnamaddr.c,v 1.33 2000/05/23 07:03:10 tron Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -903,13 +903,13 @@ _gethtbyname2(name, af)
if (num == 0) return NULL;
len = ptr - tmpbuf;
- if (len > sizeof(hostbuf)) {
+ if (len > (sizeof(hostbuf) - ALIGNBYTES)) {
free(tmpbuf);
errno = ENOSPC;
h_errno = NETDB_INTERNAL;
return NULL;
}
- ptr = memcpy(hostbuf, tmpbuf, len);
+ ptr = memcpy((void *)ALIGN(hostbuf), tmpbuf, len);
free(tmpbuf);
host.h_name = ptr;