For some reason, contrib/traceroute/traceroute.c ensures MAXHOSTNAMELEN

is defined, but then proceeds to use a hardcoded maximum hostname length
of 64 anyway.  Fix this by checking against MAXHOSTNAMELEN instead.

PR:		bin/157732
MFC after:	3 days
This commit is contained in:
Dimitry Andric 2011-06-26 19:03:33 +00:00
parent 1d9a9b79d0
commit 4b9414ab92

View File

@ -1618,7 +1618,7 @@ gethostinfo(register char *hostname)
register char **p;
register u_int32_t addr, *ap;
if (strlen(hostname) > 64) {
if (strlen(hostname) >= MAXHOSTNAMELEN) {
Fprintf(stderr, "%s: hostname \"%.32s...\" is too long\n",
prog, hostname);
exit(1);