mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2024-12-28 16:53:49 +00:00
NFSD: Cap the number of bytes copied by nfs4_reset_recoverydir()
It's only current caller already length-checks the string, but let's
be safe.
Fixes: 0964a3d3f1
("[PATCH] knfsd: nfsd4 reboot dirname fix")
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
This commit is contained in:
parent
30c1d2411a
commit
f64ea4af43
@ -659,7 +659,8 @@ nfs4_reset_recoverydir(char *recdir)
|
||||
return status;
|
||||
status = -ENOTDIR;
|
||||
if (d_is_dir(path.dentry)) {
|
||||
strcpy(user_recovery_dirname, recdir);
|
||||
strscpy(user_recovery_dirname, recdir,
|
||||
sizeof(user_recovery_dirname));
|
||||
status = 0;
|
||||
}
|
||||
path_put(&path);
|
||||
|
Loading…
Reference in New Issue
Block a user