Commit 350c73af authored by Chuck Lever's avatar Chuck Lever Committed by Trond Myklebust

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: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent fdc6e2c8
...@@ -1153,7 +1153,7 @@ static int nfs_validate_mount_data(struct nfs_mount_data **options, ...@@ -1153,7 +1153,7 @@ static int nfs_validate_mount_data(struct nfs_mount_data **options,
c = strchr(dev_name, ':'); c = strchr(dev_name, ':');
if (c == NULL) if (c == NULL)
return -EINVAL; return -EINVAL;
len = c - dev_name - 1; len = c - dev_name;
if (len > sizeof(data->hostname)) if (len > sizeof(data->hostname))
return -EINVAL; return -EINVAL;
strncpy(data->hostname, dev_name, len); strncpy(data->hostname, dev_name, len);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment