Skip to contentSkip to conversation

fix nfs symlink name corruption

PATCH New Ed Swarthout 3 participants 3 messages Nov 19, 2009 – Dec 7, 2009 Networking

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix nfs symlink name corruption

An off by one error may cause nfs readlink lookup fail if nfs_path_buff has non-zero data from a previous use.

Loading: *** ERROR: File lookup fail

---
 net/nfs.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/nfs.c +1 -1
index 27395fb..c39f616 100644
@@ -516,7 +516,7 @@ nfs_readlink_reply (uchar *pkt, unsigned len)
 		strcat (nfs_path, "/");
 		pathlen = strlen(nfs_path);
 		memcpy (nfs_path+pathlen, (uchar *)&(rpc_pkt.u.reply.data[2]), rlen);
-		nfs_path[pathlen+rlen+1] = 0;
+		nfs_path[pathlen + rlen] = 0;
 	} else {
 		memcpy (nfs_path, (uchar *)&(rpc_pkt.u.reply.data[2]), rlen);
 		nfs_path[rlen] = 0;
Signature · 1 line
1.5.6.5
#1 lore raw

PATCH 1/1 fix nfs symlink name corruption

Dear Ed Swarthout,

Quoted 9 lines · In message <[email protected]> you…

An off by one error may cause nfs readlink lookup fail if nfs_path_buff has non-zero data from a previous use.

Loading: *** ERROR: File lookup fail

---
 net/nfs.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Applied.

Ben, I hope this is OK with you. Looked obvious to me.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I can't understand it. I can't even understand  the  people  who  can
understand it.                    - Queen Juliana of the Netherlands.
#2 lore raw

PATCH 1/1 fix nfs symlink name corruption

Quoted 15 lines · Wolfgang Denk

Dear Ed Swarthout,

Quoted 10 lines · In message <[email protected]> you…

An off by one error may cause nfs readlink lookup fail if nfs_path_buff has non-zero data from a previous use.

Loading: *** ERROR: File lookup fail

---
 net/nfs.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Quoted 9 lines

Applied.

Ben, I hope this is OK with you. Looked obvious to me.

Best regards,

Wolfgang Denk

Fine with me. Thanks for taking care of this.

Ben