From: florian Date: Tue, 20 Jan 2015 18:44:16 +0000 (+0000) Subject: HOST_NAME_MAX + 1 is big enough for gethostname(3); this array has X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=1bdf051fda8b701617c46cf5096dffac98e74ee5;p=openbsd HOST_NAME_MAX + 1 is big enough for gethostname(3); this array has been one char too big when it was defined in terms of MAXHOSTNAMELEN. While here, NI_MAXHOST is big enough for getnameinfo(3). OK benno@ --- diff --git a/usr.sbin/traceroute/traceroute.c b/usr.sbin/traceroute/traceroute.c index 257cf69ff9d..89527f4ebb8 100644 --- a/usr.sbin/traceroute/traceroute.c +++ b/usr.sbin/traceroute/traceroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: traceroute.c,v 1.135 2015/01/16 06:40:22 deraadt Exp $ */ +/* $OpenBSD: traceroute.c,v 1.136 2015/01/20 18:44:16 florian Exp $ */ /* $NetBSD: traceroute.c,v 1.10 1995/05/21 15:50:45 mycroft Exp $ */ /* @@ -1459,7 +1459,7 @@ packet_ok6(struct msghdr *mhdr, int cc, int seq, int iflag) return (ICMP6_DST_UNREACH_NOPORT + 1); } if (verbose) { - char sbuf[NI_MAXHOST+1], dbuf[INET6_ADDRSTRLEN]; + char sbuf[NI_MAXHOST], dbuf[INET6_ADDRSTRLEN]; u_int8_t *p; int i; @@ -1703,7 +1703,7 @@ in_cksum(u_short *addr, int len) const char * inetname(struct sockaddr *sa) { - static char line[NI_MAXHOST], domain[HOST_NAME_MAX+1 + 1]; + static char line[NI_MAXHOST], domain[HOST_NAME_MAX + 1]; static int first = 1; char *cp;