From cc19216028038523578d8437fd5fe68bada0def0 Mon Sep 17 00:00:00 2001 From: deraadt <> Date: Tue, 30 Jul 2002 00:45:19 +0000 Subject: more strlcpy; itojun ok --- src/lib/libc/net/gethostnamadr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/lib/libc/net/gethostnamadr.c b/src/lib/libc/net/gethostnamadr.c index dae31eaedb..423fb906b8 100644 --- a/src/lib/libc/net/gethostnamadr.c +++ b/src/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 @@ -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; } -- cgit v1.2.3-55-g6feb