diff options
author | peter <peter@FreeBSD.org> | 1996-08-12 14:00:26 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1996-08-12 14:00:26 +0000 |
commit | c2fcbeb6ff1e38452f855641439831a4746ef02a (patch) | |
tree | 5ef6d941ce8ca2df8701e926198d01206fc35900 /lib/libc/rpc/getrpcport.c | |
parent | 633999a94babb0ab1ca53d9f3c8d9d8d70423752 (diff) | |
download | FreeBSD-src-c2fcbeb6ff1e38452f855641439831a4746ef02a.zip FreeBSD-src-c2fcbeb6ff1e38452f855641439831a4746ef02a.tar.gz |
clear various struct sockaddr_in's on stack, set sin_len.
(Noticed when comparing to OpenBSD source)
Diffstat (limited to 'lib/libc/rpc/getrpcport.c')
-rw-r--r-- | lib/libc/rpc/getrpcport.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libc/rpc/getrpcport.c b/lib/libc/rpc/getrpcport.c index 5c54473..91af220 100644 --- a/lib/libc/rpc/getrpcport.c +++ b/lib/libc/rpc/getrpcport.c @@ -30,7 +30,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)getrpcport.c 1.3 87/08/11 SMI";*/ /*static char *sccsid = "from: @(#)getrpcport.c 2.1 88/07/29 4.0 RPCSRC";*/ -static char *rcsid = "$Id: getrpcport.c,v 1.3 1995/10/22 14:51:26 phk Exp $"; +static char *rcsid = "$Id: getrpcport.c,v 1.4 1996/06/08 22:54:52 jraynard Exp $"; #endif /* @@ -54,7 +54,9 @@ int getrpcport(host, prognum, versnum, proto) if ((hp = gethostbyname(host)) == NULL) return (0); + memset(&addr, 0, sizeof(addr)); bcopy(hp->h_addr, (char *) &addr.sin_addr, hp->h_length); + addr.sin_len = sizeof(struct sockaddr_in); addr.sin_family = AF_INET; addr.sin_port = 0; return (pmap_getport(&addr, prognum, versnum, proto)); |