public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Latchesar Ionkov <lucho@ionkov.net>
To: Andrew Morton <akpm@osdl.org>
Cc: v9fs-developer@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: [PATCH] v9fs: symlink support fixes
Date: Fri, 20 Jan 2006 20:26:40 -0500	[thread overview]
Message-ID: <20060121012640.GA2084@ionkov.net> (raw)

two symlink fixes, v9fs_readlink didn't copy the last character of the
symlink name, v9fs_vfs_follow_link incorrectly called strlen of newly
allocated buffer instead of PATH_MAX.

Signed-off-by: Latchesar Ionkov <lucho@ionkov.net>

---
commit 80543589e5ab35e0fda3e97f93108f136eb4e623
tree 78150d708f7d815a3aa64967741f1aa9df60be9f
parent 3ee68c4af3fd7228c1be63254b9f884614f9ebb2
author Latchesar Ionkov <lucho@ionkov.net> Fri, 20 Jan 2006 20:20:38 -0500
committer Latchesar Ionkov <lucho@ionkov.net> Fri, 20 Jan 2006 20:20:38 -0500

 fs/9p/vfs_inode.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index 91f5524..63e5b03 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -886,8 +886,8 @@ static int v9fs_readlink(struct dentry *
 	}
 
 	/* copy extension buffer into buffer */
-	if (fcall->params.rstat.stat.extension.len < buflen)
-		buflen = fcall->params.rstat.stat.extension.len;
+	if (fcall->params.rstat.stat.extension.len+1 < buflen)
+		buflen = fcall->params.rstat.stat.extension.len + 1;
 
 	memcpy(buffer, fcall->params.rstat.stat.extension.str, buflen - 1);
 	buffer[buflen-1] = 0;
@@ -951,7 +951,7 @@ static void *v9fs_vfs_follow_link(struct
 	if (!link)
 		link = ERR_PTR(-ENOMEM);
 	else {
-		len = v9fs_readlink(dentry, link, strlen(link));
+		len = v9fs_readlink(dentry, link, PATH_MAX);
 
 		if (len < 0) {
 			__putname(link);

                 reply	other threads:[~2006-01-21  1:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060121012640.GA2084@ionkov.net \
    --to=lucho@ionkov.net \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=v9fs-developer@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox