From 367179a7f968f2153fb576b8a18dab6f8fd39c86 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 21 Dec 1997 21:20:11 +0000 Subject: (callrpc): Use strncpy instead of strcpy for security reasons. --- sunrpc/clnt_simp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3