should bzero automatic sockaddr's before use

This commit is contained in:
deraadt 1993-12-05 13:26:52 +00:00
parent 40293f757f
commit df1ab8279c
2 changed files with 4 additions and 2 deletions

View File

@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)netdate.c 5.2 (Berkeley) 2/25/91";*/
static char rcsid[] = "$Id: netdate.c,v 1.4 1993/08/01 19:00:17 mycroft Exp $";
static char rcsid[] = "$Id: netdate.c,v 1.5 1993/12/05 13:26:52 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -77,6 +77,7 @@ netsettime(tval)
return (retval = 2);
}
bzero((char *)&dest, sizeof dest);
dest.sin_port = sp->s_port;
dest.sin_family = AF_INET;
dest.sin_addr.s_addr = htonl((u_long)INADDR_ANY);

View File

@ -39,7 +39,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)mount.c 5.44 (Berkeley) 2/26/91";*/
static char rcsid[] = "$Id: mount.c,v 1.6 1993/09/07 15:40:25 ws Exp $";
static char rcsid[] = "$Id: mount.c,v 1.7 1993/12/05 13:34:51 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -747,6 +747,7 @@ getnfsargs(spec, nfsargsp)
(void) fprintf(stderr, "mount: Can't get net id for host\n");
return (0);
}
bzero((char *)&saddr, sizeof saddr);
bcopy(hp->h_addr, (caddr_t)&saddr.sin_addr, hp->h_length);
nfhret.stat = ETIMEDOUT; /* Mark not yet successful */
while (retrycnt > 0) {