From: Ulrich Drepper Date: Sun, 21 Dec 1997 21:20:11 +0000 (+0000) Subject: (callrpc): Use strncpy instead of strcpy for security reasons. X-Git-Tag: cvs/glibc-2_0_6pre5~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=367179a7f968f2153fb576b8a18dab6f8fd39c86;p=thirdparty%2Fglibc.git (callrpc): Use strncpy instead of strcpy for security reasons. --- diff --git a/sunrpc/clnt_simp.c b/sunrpc/clnt_simp.c index dd2ae75f1ef..2c27388108d 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;