diff options
author | Warner Losh <imp@FreeBSD.org> | 2002-06-26 06:31:06 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 2002-06-26 06:31:06 +0000 |
commit | 4cbd2472b355c6fbcccd0bb1e83eb12bcc390076 (patch) | |
tree | 012242710b10a00c0c309499ba6a74eb9bb3e4f2 /lib/libc | |
parent | fda8311189d3634ee588b41c80e3eb31f0fa2859 (diff) | |
download | src-4cbd2472b355c6fbcccd0bb1e83eb12bcc390076.tar.gz src-4cbd2472b355c6fbcccd0bb1e83eb12bcc390076.zip |
Don't allow buffer overflow here either.
Notes
Notes:
svn path=/head/; revision=98860
Diffstat (limited to 'lib/libc')
-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 a84fde514f8b..730d796f01be 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++; |