diff options
author | brian <brian@FreeBSD.org> | 1999-04-07 08:27:45 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1999-04-07 08:27:45 +0000 |
commit | c6c6c7de65eae103002ebb9bee8881e1e2e903df (patch) | |
tree | 18fb09ba4ed57096b2a23fd9d28689784a00024b /libexec/rlogind | |
parent | 32ff8071a15df941cbe4d98c0badea284464f320 (diff) | |
download | FreeBSD-src-c6c6c7de65eae103002ebb9bee8881e1e2e903df.zip FreeBSD-src-c6c6c7de65eae103002ebb9bee8881e1e2e903df.tar.gz |
Ensure that things returned by gethostname() and
friends are terminated and allow for a maximum
host name length of MAXHOSTNAMELEN - 1.
Put parenthesis around sizeof args.
Make some variables static.
Fix telnetd -u (broken by my last commit)
Prompted by: bde
Diffstat (limited to 'libexec/rlogind')
-rw-r--r-- | libexec/rlogind/rlogind.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libexec/rlogind/rlogind.c b/libexec/rlogind/rlogind.c index a7cdba5..9974ed6 100644 --- a/libexec/rlogind/rlogind.c +++ b/libexec/rlogind/rlogind.c @@ -42,7 +42,7 @@ static const char copyright[] = static const char sccsid[] = "@(#)rlogind.c 8.1 (Berkeley) 6/4/93"; #endif static const char rcsid[] = - "$Id: rlogind.c,v 1.20 1998/12/16 07:20:44 peter Exp $"; + "$Id: rlogind.c,v 1.21 1999/04/06 23:05:58 brian Exp $"; #endif /* not lint */ /* @@ -211,7 +211,7 @@ doit(f, fromp) { int master, pid, on = 1; int authenticated = 0; - char hostname[2 * MAXHOSTNAMELEN + 1]; + char hostname[MAXHOSTNAMELEN]; char c; alarm(60); @@ -226,7 +226,7 @@ doit(f, fromp) alarm(0); fromp->sin_port = ntohs((u_short)fromp->sin_port); - realhostname(hostname, sizeof hostname - 1, &fromp->sin_addr); + realhostname(hostname, sizeof(hostname) - 1, &fromp->sin_addr); hostname[sizeof(hostname) - 1] = '\0'; #ifdef KERBEROS |