summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-04-29 21:25:21 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-04-29 21:25:21 +0000
commit2313c296fd18b09984e80b4df5b164aa92f31018 (patch)
tree7fb93ebbf01d7d5bf40e2082f6931a4efcd9856d /lib/libc
parentdeee996d38a4d86ef8de31f173f2aca4566b2229 (diff)
possible buf oflow
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/yp/yp_bind.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libc/yp/yp_bind.c b/lib/libc/yp/yp_bind.c
index 9de9e0a841d..6738701d48e 100644
--- a/lib/libc/yp/yp_bind.c
+++ b/lib/libc/yp/yp_bind.c
@@ -31,7 +31,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: yp_bind.c,v 1.8 1997/02/05 19:19:49 deraadt Exp $";
+static char *rcsid = "$OpenBSD: yp_bind.c,v 1.9 1997/04/29 21:25:20 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -226,7 +226,8 @@ gotdata:
sizeof(ysd->dom_server_addr.sin_addr.s_addr));
ysd->dom_server_port = ysd->dom_server_addr.sin_port;
ysd->dom_vers = YPVERS;
- (void)strcpy(ysd->dom_domain, dom);
+ (void)strncpy(ysd->dom_domain, dom, sizeof ysd->dom_domain-1);
+ ysd->dom_domain[sizeof ysd->dom_domain-1] = '\0';
}
tv.tv_sec = _yplib_timeout / 2;
tv.tv_usec = 0;