]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(callrpc): Use strncpy instead of strcpy for security reasons.
authorUlrich Drepper <drepper@redhat.com>
Sun, 21 Dec 1997 21:20:11 +0000 (21:20 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sun, 21 Dec 1997 21:20:11 +0000 (21:20 +0000)
sunrpc/clnt_simp.c

index dd2ae75f1efc4cca85b5be6e7df21d04fa79b4db..2c27388108d36c8133da9c35977d9d021e21e6f4 100644 (file)
@@ -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;