diff options
Diffstat (limited to 'src/lib/libc')
| -rw-r--r-- | src/lib/libc/net/gethostnamadr.c | 8 |
1 files changed, 4 insertions, 4 deletions
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 @@ | |||
| 52 | */ | 52 | */ |
| 53 | 53 | ||
| 54 | #if defined(LIBC_SCCS) && !defined(lint) | 54 | #if defined(LIBC_SCCS) && !defined(lint) |
| 55 | static char rcsid[] = "$OpenBSD: gethostnamadr.c,v 1.50 2002/07/29 10:15:30 itojun Exp $"; | 55 | static char rcsid[] = "$OpenBSD: gethostnamadr.c,v 1.51 2002/07/30 00:45:19 deraadt Exp $"; |
| 56 | #endif /* LIBC_SCCS and not lint */ | 56 | #endif /* LIBC_SCCS and not lint */ |
| 57 | 57 | ||
| 58 | #include <sys/param.h> | 58 | #include <sys/param.h> |
| @@ -276,7 +276,7 @@ getanswer(answer, anslen, qname, qtype) | |||
| 276 | had_error++; | 276 | had_error++; |
| 277 | continue; | 277 | continue; |
| 278 | } | 278 | } |
| 279 | strcpy(bp, tbuf); | 279 | strlcpy(bp, tbuf, ep - bp); |
| 280 | host.h_name = bp; | 280 | host.h_name = bp; |
| 281 | bp += n; | 281 | bp += n; |
| 282 | continue; | 282 | continue; |
| @@ -298,7 +298,7 @@ getanswer(answer, anslen, qname, qtype) | |||
| 298 | had_error++; | 298 | had_error++; |
| 299 | continue; | 299 | continue; |
| 300 | } | 300 | } |
| 301 | strcpy(bp, tbuf); | 301 | strlcpy(bp, tbuf, ep - bp); |
| 302 | tname = bp; | 302 | tname = bp; |
| 303 | bp += n; | 303 | bp += n; |
| 304 | continue; | 304 | continue; |
| @@ -414,7 +414,7 @@ getanswer(answer, anslen, qname, qtype) | |||
| 414 | n = strlen(qname) + 1; /* for the \0 */ | 414 | n = strlen(qname) + 1; /* for the \0 */ |
| 415 | if (n > ep - bp) | 415 | if (n > ep - bp) |
| 416 | goto try_again; | 416 | goto try_again; |
| 417 | strcpy(bp, qname); | 417 | strlcpy(bp, qname, ep - bp); |
| 418 | host.h_name = bp; | 418 | host.h_name = bp; |
| 419 | bp += n; | 419 | bp += n; |
| 420 | } | 420 | } |
