diff options
author | brian <brian@FreeBSD.org> | 2001-03-09 20:31:02 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 2001-03-09 20:31:02 +0000 |
commit | c46089815b36c89c975b82747cb02876915674ee (patch) | |
tree | 38259242c5aa6ddde2bfbcf2ac7fd229da19a542 /usr.sbin/ppp | |
parent | 872730b33181c11454a6cf1480b5f39a5773af5a (diff) | |
download | FreeBSD-src-c46089815b36c89c975b82747cb02876915674ee.zip FreeBSD-src-c46089815b36c89c975b82747cb02876915674ee.tar.gz |
MAXHOSTNAME includes space for a NUL
Diffstat (limited to 'usr.sbin/ppp')
-rw-r--r-- | usr.sbin/ppp/ip.c | 12 | ||||
-rw-r--r-- | usr.sbin/ppp/ipcp.c | 2 | ||||
-rw-r--r-- | usr.sbin/ppp/prompt.c | 2 | ||||
-rw-r--r-- | usr.sbin/ppp/radius.c | 4 |
4 files changed, 10 insertions, 10 deletions
diff --git a/usr.sbin/ppp/ip.c b/usr.sbin/ppp/ip.c index fa265bb..34aa1c2 100644 --- a/usr.sbin/ppp/ip.c +++ b/usr.sbin/ppp/ip.c @@ -465,19 +465,19 @@ ip_LogDNS(const struct udphdr *uh, const char *direction) if (header.opcode == OPCODE_QUERY && header.qr == 0) { /* rfc1035 */ - char name[MAXHOSTNAMELEN + 1], *n; + char namewithdot[MAXHOSTNAMELEN + 1], *n; const char *qtype, *qclass; const u_char *end; - n = name; + n = namewithdot; end = ptr + len - 4; - if (end - ptr >= sizeof name) - end = ptr + sizeof name - 1; + if (end - ptr >= sizeof namewithdot) + end = ptr + sizeof namewithdot - 1; while (ptr < end) { len = *ptr++; if (len > end - ptr) len = end - ptr; - if (n != name) + if (n != namewithdot) *n++ = '.'; memcpy(n, ptr, len); ptr += len; @@ -488,7 +488,7 @@ ip_LogDNS(const struct udphdr *uh, const char *direction) qclass = dns_Qclass2Txt(ntohs(*(const u_short *)(end + 2))); log_Printf(LogDNS, "%sbound query %s %s %s\n", - direction, qclass, qtype, name); + direction, qclass, qtype, namewithdot); } } diff --git a/usr.sbin/ppp/ipcp.c b/usr.sbin/ppp/ipcp.c index b10657a..6369a48 100644 --- a/usr.sbin/ppp/ipcp.c +++ b/usr.sbin/ppp/ipcp.c @@ -541,7 +541,7 @@ ipcp_Init(struct ipcp *ipcp, struct bundle *bundle, struct link *l, const struct fsm_parent *parent) { struct hostent *hp; - char name[MAXHOSTNAMELEN + 1]; + char name[MAXHOSTNAMELEN]; static const char * const timer_names[] = {"IPCP restart", "IPCP openmode", "IPCP stopped"}; diff --git a/usr.sbin/ppp/prompt.c b/usr.sbin/ppp/prompt.c index 0aafbe3..1362ee6 100644 --- a/usr.sbin/ppp/prompt.c +++ b/usr.sbin/ppp/prompt.c @@ -79,7 +79,7 @@ static void prompt_Display(struct prompt *p) { /* XXX: See Index2Nam() - should we only figure this out once ? */ - static char shostname[MAXHOSTNAMELEN + 1]; + static char shostname[MAXHOSTNAMELEN]; const char *pconnect, *pauth; if (p->TermMode || !p->needprompt) diff --git a/usr.sbin/ppp/radius.c b/usr.sbin/ppp/radius.c index b031a52..79c81b0 100644 --- a/usr.sbin/ppp/radius.c +++ b/usr.sbin/ppp/radius.c @@ -373,7 +373,7 @@ radius_Authenticate(struct radius *r, struct authinfo *authp, const char *name, struct ttyent *ttyp; struct timeval tv; int got, slot; - char hostname[MAXHOSTNAMELEN + 1]; + char hostname[MAXHOSTNAMELEN]; struct hostent *hp; struct in_addr hostaddr; @@ -493,7 +493,7 @@ radius_Account(struct radius *r, struct radacct *ac, struct datalink *dl, struct ttyent *ttyp; struct timeval tv; int got, slot; - char hostname[MAXHOSTNAMELEN + 1]; + char hostname[MAXHOSTNAMELEN]; struct hostent *hp; struct in_addr hostaddr; |