diff options
author | dg <dg@FreeBSD.org> | 1995-05-15 09:56:49 +0000 |
---|---|---|
committer | dg <dg@FreeBSD.org> | 1995-05-15 09:56:49 +0000 |
commit | c643e3acd9013c5cf4c2b0e3976d702c5558a6dc (patch) | |
tree | 7990a17de60e99fbd694ce1a7c561e3d6912b73f /usr.sbin | |
parent | 17fc6d821ba7bf0df9f5d1e8ec9f23f3ea7eb972 (diff) | |
download | FreeBSD-src-c643e3acd9013c5cf4c2b0e3976d702c5558a6dc.zip FreeBSD-src-c643e3acd9013c5cf4c2b0e3976d702c5558a6dc.tar.gz |
Fully initialize (bzero) the stack-allocated "struct sockaddr_in server"
structure. Random junk on the stack would cause the call to bind to fail
in some cases (since the address portion wasn't initialized).
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/timed/timed/timed.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.sbin/timed/timed/timed.c b/usr.sbin/timed/timed/timed.c index b8f7dc7..e134a27 100644 --- a/usr.sbin/timed/timed/timed.c +++ b/usr.sbin/timed/timed/timed.c @@ -42,7 +42,7 @@ static char sccsid[] = "@(#)timed.c 8.1 (Berkeley) 6/6/93"; #endif /* not lint */ #ifdef sgi -#ident "$Revision: 1.25 $" +#ident "$Revision: 1.1.1.1 $" #endif /* sgi */ #define TSPTYPES @@ -312,6 +312,7 @@ main(argc, argv) exit(1); } port = srvp->s_port; + bzero(&server, sizeof(struct sockaddr_in)); server.sin_port = srvp->s_port; server.sin_family = AF_INET; sock = socket(AF_INET, SOCK_DGRAM, 0); |