summaryrefslogtreecommitdiff
path: root/usr.bin/finger/net.c
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>1998-06-09 04:31:02 +0000
committerWarner Losh <imp@FreeBSD.org>1998-06-09 04:31:02 +0000
commita716ad6693847224d462f50b79628fa78dafc859 (patch)
tree68c7880163e0a885103d61ee66ddea0faa64d288 /usr.bin/finger/net.c
parentf34c49eb546e3858af3c081200cc81c5e8438b01 (diff)
downloadsrc-test2-a716ad6693847224d462f50b79628fa78dafc859.tar.gz
src-test2-a716ad6693847224d462f50b79628fa78dafc859.zip
Notes
Diffstat (limited to 'usr.bin/finger/net.c')
-rw-r--r--usr.bin/finger/net.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/finger/net.c b/usr.bin/finger/net.c
index 5c4b2f0162c9..7d7b25c5c575 100644
--- a/usr.bin/finger/net.c
+++ b/usr.bin/finger/net.c
@@ -39,11 +39,12 @@
static char sccsid[] = "@(#)net.c 8.4 (Berkeley) 4/28/95";
#else
static const char rcsid[] =
- "$Id: net.c,v 1.8 1997/07/02 06:34:50 charnier Exp $";
+ "$Id: net.c,v 1.9 1997/08/01 20:10:44 wollman Exp $";
#endif
#endif /* not lint */
#include <sys/types.h>
+#include <sys/param.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
@@ -96,7 +97,7 @@ netfinger(name)
return;
}
sin.sin_family = hp->h_addrtype;
- bcopy(hp->h_addr, (char *)&sin.sin_addr, hp->h_length);
+ bcopy(hp->h_addr, (char *)&sin.sin_addr, MIN(hp->h_length,sizeof(sin.sin_addr)));
sin.sin_port = sp->s_port;
if ((s = socket(hp->h_addrtype, SOCK_STREAM, 0)) < 0) {
perror("finger: socket");