Don't allow buffer overflow here either.

This commit is contained in:
Warner Losh 2002-06-26 06:31:06 +00:00
parent fda8311189
commit 4cbd2472b3

View File

@ -176,7 +176,9 @@ static char *net_aliases[MAXALIASES], netbuf[PACKETSZ];
}
cp += n;
*ap++ = bp;
bp += strlen(bp) + 1;
n = strlen(bp) + 1;
bp += n;
buflen -= n;
net_entry.n_addrtype =
(class == C_IN) ? AF_INET : AF_UNSPEC;
haveanswer++;