summaryrefslogtreecommitdiffstats
path: root/libexec/tftpd/tftpd.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1999-04-07 08:27:45 +0000
committerbrian <brian@FreeBSD.org>1999-04-07 08:27:45 +0000
commitc6c6c7de65eae103002ebb9bee8881e1e2e903df (patch)
tree18fb09ba4ed57096b2a23fd9d28689784a00024b /libexec/tftpd/tftpd.c
parent32ff8071a15df941cbe4d98c0badea284464f320 (diff)
downloadFreeBSD-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/tftpd/tftpd.c')
-rw-r--r--libexec/tftpd/tftpd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libexec/tftpd/tftpd.c b/libexec/tftpd/tftpd.c
index f1f8a9a..54cda4b 100644
--- a/libexec/tftpd/tftpd.c
+++ b/libexec/tftpd/tftpd.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)tftpd.c 8.1 (Berkeley) 6/4/93";
#endif
static const char rcsid[] =
- "$Id: tftpd.c,v 1.12 1998/10/30 16:17:39 dg Exp $";
+ "$Id: tftpd.c,v 1.13 1999/04/06 23:05:59 brian Exp $";
#endif /* not lint */
/*
@@ -325,10 +325,10 @@ again:
}
ecode = (*pf->f_validate)(&filename, tp->th_opcode);
if (logging) {
- char host[MAXHOSTNAMELEN + 1];
+ char host[MAXHOSTNAMELEN];
- realhostname(host, sizeof host - 1, &from.sin_addr);
- host[sizeof host - 1] = '\0';
+ realhostname(host, sizeof(host) - 1, &from.sin_addr);
+ host[sizeof(host) - 1] = '\0';
syslog(LOG_INFO, "%s: %s request for %s: %s", host,
tp->th_opcode == WRQ ? "write" : "read",
filename, errtomsg(ecode));
OpenPOWER on IntegriCloud