mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 20:51:44 +00:00
NFS: Off-by-one length error in string handling
The hostname was getting truncated in the new text-based NFS mount API. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
This commit is contained in:
parent
fdc6e2c8c0
commit
350c73af6a
@ -1153,7 +1153,7 @@ static int nfs_validate_mount_data(struct nfs_mount_data **options,
|
||||
c = strchr(dev_name, ':');
|
||||
if (c == NULL)
|
||||
return -EINVAL;
|
||||
len = c - dev_name - 1;
|
||||
len = c - dev_name;
|
||||
if (len > sizeof(data->hostname))
|
||||
return -EINVAL;
|
||||
strncpy(data->hostname, dev_name, len);
|
||||
|
Loading…
Reference in New Issue
Block a user