diff options
author | imp <imp@FreeBSD.org> | 2002-06-26 06:31:06 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2002-06-26 06:31:06 +0000 |
commit | d36b92c7bb65d6b90c37a0e90f87624cf5d65856 (patch) | |
tree | 012242710b10a00c0c309499ba6a74eb9bb3e4f2 | |
parent | 3eb1b04697ca128ee0c868eb6faab8df35e91c13 (diff) | |
download | FreeBSD-src-d36b92c7bb65d6b90c37a0e90f87624cf5d65856.zip FreeBSD-src-d36b92c7bb65d6b90c37a0e90f87624cf5d65856.tar.gz |
Don't allow buffer overflow here either.
-rw-r--r-- | lib/libc/net/getnetbydns.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libc/net/getnetbydns.c b/lib/libc/net/getnetbydns.c index a84fde5..730d796 100644 --- a/lib/libc/net/getnetbydns.c +++ b/lib/libc/net/getnetbydns.c @@ -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++; |