Linux NFS development
 help / color / mirror / Atom feed
* [PATCH] NFS: fix length computation in nfs_validate_mount_data
@ 2007-08-29 19:26 James Lentini
  2007-08-29 20:30 ` Chuck Lever
  0 siblings, 1 reply; 6+ messages in thread
From: James Lentini @ 2007-08-29 19:26 UTC (permalink / raw)
  To: trond.myklebust; +Cc: nfs


While experimenting with the new string mount infrastructure, I 
noticed an off by one error in the computation of the hostname's 
length. This patch fixes the length computation to match the same 
computation in nfs4_validate_mount_data().

Signed-off-by: James Lentini <jlentini@netapp.com>
---

 fs/nfs/super.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- fs/nfs/super.c	2007-08-29 15:06:59.320932000 -0400
+++ fs/nfs/super.c	2007-08-29 15:07:51.439960000 -0400
@@ -1153,7 +1153,7 @@ static int nfs_validate_mount_data(struc
 		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);

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-08-29 21:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-29 19:26 [PATCH] NFS: fix length computation in nfs_validate_mount_data James Lentini
2007-08-29 20:30 ` Chuck Lever
2007-08-29 20:40   ` Trond Myklebust
2007-08-29 21:06     ` Chuck Lever
2007-08-29 21:10       ` Trond Myklebust
2007-08-29 20:56   ` James Lentini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox