From df1ab8279c1bf104775d5214415447f45781e9cc Mon Sep 17 00:00:00 2001 From: deraadt Date: Sun, 5 Dec 1993 13:26:52 +0000 Subject: [PATCH] should bzero automatic sockaddr's before use --- bin/date/netdate.c | 3 ++- sbin/mount/mount.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/date/netdate.c b/bin/date/netdate.c index 895e656237b8..4fb86e2b6685 100644 --- a/bin/date/netdate.c +++ b/bin/date/netdate.c @@ -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 @@ -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); diff --git a/sbin/mount/mount.c b/sbin/mount/mount.c index 6d7ceea28a13..44e057aad8e5 100644 --- a/sbin/mount/mount.c +++ b/sbin/mount/mount.c @@ -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 @@ -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) {