]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/nfs/client.c
nfs: Avoid overrun when copying client IP address string
[karo-tx-linux.git] / fs / nfs / client.c
index 5ee23e7058b305c061a4e1449fdccc722a68eceb..9d6a0e4a75188746f6e8fcd2c1066ec46dfeea03 100644 (file)
@@ -983,7 +983,7 @@ static int nfs4_init_client(struct nfs_client *clp,
                                        RPC_CLNT_CREATE_DISCRTRY);
        if (error < 0)
                goto error;
-       memcpy(clp->cl_ipaddr, ip_addr, sizeof(clp->cl_ipaddr));
+       strlcpy(clp->cl_ipaddr, ip_addr, sizeof(clp->cl_ipaddr));
 
        error = nfs_idmap_new(clp);
        if (error < 0) {