[U-Boot] [PATCH 9/9] ubifs: Add '\0' to the end of the realpath

Ricardo Ribalda Delgado ricardo.ribalda at uam.es
Fri Apr 24 13:50:15 CEST 2009


---
 fs/ubifs/ubifs.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c
index 0708d90..4dc315e 100644
--- a/fs/ubifs/ubifs.c
+++ b/fs/ubifs/ubifs.c
@@ -646,6 +646,8 @@ int ubifs_load(char *filename, u32 addr, u32 size)
 	ui = ubifs_inode(inode);
 	if (((inode->i_mode & S_IFMT) == S_IFLNK) && ui->data_len) {
 		memcpy(link_name, ui->data, ui->data_len);
+		link_name[ui->data_len]='\0';
+		memcpy(link_name, ui->data, ui->data_len);
 		printf("%s is linked to %s!\n", filename, link_name);
 		ubifs_iput(inode);
 
-- 
1.6.2.4



More information about the U-Boot mailing list