From: Chuck Lever Date: Wed, 29 Aug 2007 21:59:01 +0000 (-0400) Subject: NFS: Off-by-one length error in string handling X-Git-Tag: v2.6.23-rc6~23^2~2 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=350c73af6af51ae7654dad91874c0d30dd13bbbe;p=linux-2.6 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 Signed-off-by: Trond Myklebust --- diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 9cd0828010..ef3643284f 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c @@ -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);