[U-Boot] [PATCH] fix nfs symlink name corruption
Ed Swarthout
Ed.Swarthout at freescale.com
Thu Nov 19 09:47:28 CET 2009
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
Signed-off-by: Ed Swarthout <Ed.Swarthout at freescale.com>
---
net/nfs.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/nfs.c b/net/nfs.c
index 27395fb..c39f616 100644
--- a/net/nfs.c
+++ b/net/nfs.c
@@ -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;
--
1.5.6.5
More information about the U-Boot
mailing list