Skip to content

Commit 350c73a

Browse files
chuckleverTrond Myklebust
authored andcommitted
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>
1 parent fdc6e2c commit 350c73a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/nfs/super.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1153,7 +1153,7 @@ static int nfs_validate_mount_data(struct nfs_mount_data **options,
11531153
c = strchr(dev_name, ':');
11541154
if (c == NULL)
11551155
return -EINVAL;
1156-
len = c - dev_name - 1;
1156+
len = c - dev_name;
11571157
if (len > sizeof(data->hostname))
11581158
return -EINVAL;
11591159
strncpy(data->hostname, dev_name, len);

0 commit comments

Comments
 (0)