diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-07-30 00:45:20 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-07-30 00:45:20 +0000 |
commit | db2494bd1fc703f7febbe11cad2faa2e292eca62 (patch) | |
tree | 7d82997625dc3f5b1e5254ed070158e0c248e964 /lib/libc/net | |
parent | e8dafc3ee7f471f40358a20524843ff29e83e5ca (diff) |
more strlcpy; itojun ok
Diffstat (limited to 'lib/libc/net')
-rw-r--r-- | lib/libc/net/gethostnamadr.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libc/net/gethostnamadr.c b/lib/libc/net/gethostnamadr.c index dae31eaedbf..423fb906b87 100644 --- a/lib/libc/net/gethostnamadr.c +++ b/lib/libc/net/gethostnamadr.c @@ -52,7 +52,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: gethostnamadr.c,v 1.50 2002/07/29 10:15:30 itojun Exp $"; +static char rcsid[] = "$OpenBSD: gethostnamadr.c,v 1.51 2002/07/30 00:45:19 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -276,7 +276,7 @@ getanswer(answer, anslen, qname, qtype) had_error++; continue; } - strcpy(bp, tbuf); + strlcpy(bp, tbuf, ep - bp); host.h_name = bp; bp += n; continue; @@ -298,7 +298,7 @@ getanswer(answer, anslen, qname, qtype) had_error++; continue; } - strcpy(bp, tbuf); + strlcpy(bp, tbuf, ep - bp); tname = bp; bp += n; continue; @@ -414,7 +414,7 @@ getanswer(answer, anslen, qname, qtype) n = strlen(qname) + 1; /* for the \0 */ if (n > ep - bp) goto try_again; - strcpy(bp, qname); + strlcpy(bp, qname, ep - bp); host.h_name = bp; bp += n; } |