summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1997-04-29 21:25:20 +0000
committerderaadt <deraadt@openbsd.org>1997-04-29 21:25:20 +0000
commitf155a74cfd009ec0c6df942f104b5aa7e7ee83a8 (patch)
treef09f63023e975f5ed074dc51c78a51411dc56e9d /lib/libc
parentUse the new style to build vnds. General 2.1 cleanup. (diff)
downloadwireguard-openbsd-f155a74cfd009ec0c6df942f104b5aa7e7ee83a8.tar.xz
wireguard-openbsd-f155a74cfd009ec0c6df942f104b5aa7e7ee83a8.zip
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;