summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorflipk <>1997-07-15 18:33:50 +0000
committerflipk <>1997-07-15 18:33:50 +0000
commit5b0624d3771620904e033c2a373d877d907e086e (patch)
treedd706b060738943534d09b2ee2d502db2c58af81 /src
parent9f499d93099426b0764ab1dfa04eb5f5a6e7c26b (diff)
downloadopenbsd-5b0624d3771620904e033c2a373d877d907e086e.tar.gz
openbsd-5b0624d3771620904e033c2a373d877d907e086e.tar.bz2
openbsd-5b0624d3771620904e033c2a373d877d907e086e.zip
buff overflow
Diffstat (limited to 'src')
-rw-r--r--src/lib/libc/net/res_init.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/lib/libc/net/res_init.c b/src/lib/libc/net/res_init.c
index 973fdd43be..b4cee1d307 100644
--- a/src/lib/libc/net/res_init.c
+++ b/src/lib/libc/net/res_init.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: res_init.c,v 1.14 1997/04/13 21:30:43 provos Exp $ */ 1/* $OpenBSD: res_init.c,v 1.15 1997/07/15 18:33:50 flipk Exp $ */
2 2
3/* 3/*
4 * ++Copyright++ 1985, 1989, 1993 4 * ++Copyright++ 1985, 1989, 1993
@@ -60,7 +60,7 @@
60static char sccsid[] = "@(#)res_init.c 8.1 (Berkeley) 6/7/93"; 60static char sccsid[] = "@(#)res_init.c 8.1 (Berkeley) 6/7/93";
61static char rcsid[] = "$From: res_init.c,v 8.7 1996/09/28 06:51:07 vixie Exp $"; 61static char rcsid[] = "$From: res_init.c,v 8.7 1996/09/28 06:51:07 vixie Exp $";
62#else 62#else
63static char rcsid[] = "$OpenBSD: res_init.c,v 1.14 1997/04/13 21:30:43 provos Exp $"; 63static char rcsid[] = "$OpenBSD: res_init.c,v 1.15 1997/07/15 18:33:50 flipk Exp $";
64#endif 64#endif
65#endif /* LIBC_SCCS and not lint */ 65#endif /* LIBC_SCCS and not lint */
66 66
@@ -399,7 +399,11 @@ res_init()
399 if (_res.defdname[0] == 0 && 399 if (_res.defdname[0] == 0 &&
400 gethostname(buf, sizeof(_res.defdname) - 1) == 0 && 400 gethostname(buf, sizeof(_res.defdname) - 1) == 0 &&
401 (cp = strchr(buf, '.')) != NULL) 401 (cp = strchr(buf, '.')) != NULL)
402 strcpy(_res.defdname, cp + 1); 402 {
403 strncpy(_res.defdname, cp + 1,
404 sizeof(_res.defdname) - 1);
405 _res.defdname[sizeof(_res.defdname) - 1] = '\0';
406 }
403 407
404 /* find components of local domain that might be searched */ 408 /* find components of local domain that might be searched */
405 if (havesearch == 0) { 409 if (havesearch == 0) {