summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1997-12-21 21:20:11 +0000
committerUlrich Drepper <drepper@redhat.com>1997-12-21 21:20:11 +0000
commit367179a7f968f2153fb576b8a18dab6f8fd39c86 (patch)
treeb0a7a3caf0fc02f5b85527657dbf30d13cd7506e
parent355fca3b07162e7fdf25636a26432dcb538dfd29 (diff)
(callrpc): Use strncpy instead of strcpy for security reasons.
-rw-r--r--sunrpc/clnt_simp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sunrpc/clnt_simp.c b/sunrpc/clnt_simp.c
index dd2ae75f1e..2c27388108 100644
--- a/sunrpc/clnt_simp.c
+++ b/sunrpc/clnt_simp.c
@@ -118,7 +118,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, 255);
+ crp->oldhost[256] = '\0';
}
tottimeout.tv_sec = 25;
tottimeout.tv_usec = 0;