summaryrefslogtreecommitdiff
path: root/lib/libc/rpc
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-04-06 09:13:03 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-04-06 09:13:03 +0000
commit061d052bb7692db5e54767b18fdccada0ec911b9 (patch)
tree326239eb4b7d935f3ad4ad8377da9af40914b6cf /lib/libc/rpc
parent2f76ab93df608645b3823d11d81138e153538df3 (diff)
strncpy
Diffstat (limited to 'lib/libc/rpc')
-rw-r--r--lib/libc/rpc/clnt_simple.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libc/rpc/clnt_simple.c b/lib/libc/rpc/clnt_simple.c
index bc127b03d9a..1ecd963fa87 100644
--- a/lib/libc/rpc/clnt_simple.c
+++ b/lib/libc/rpc/clnt_simple.c
@@ -1,3 +1,4 @@
+
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
* unrestricted use provided that this legend is included on all tape
@@ -28,7 +29,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: clnt_simple.c,v 1.6 1996/12/10 07:46:33 deraadt Exp $";
+static char *rcsid = "$OpenBSD: clnt_simple.c,v 1.7 1997/04/06 09:13:02 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -102,7 +103,8 @@ callrpc(host, prognum, versnum, procnum, inproc, in, outproc, out)
crp->valid = 1;
crp->oldprognum = prognum;
crp->oldversnum = versnum;
- (void) strcpy(crp->oldhost, host);
+ (void) strncpy(crp->oldhost, host, MAXHOSTNAMELEN-1);
+ crp->oldhost[MAXHOSTNAMELEN-1] = '\0';
}
tottimeout.tv_sec = 25;
tottimeout.tv_usec = 0;