summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorRicardo Ribalda Delgado <ricardo.ribalda@uam.es>2009-04-27 09:13:31 +0200
committerWolfgang Denk <wd@denx.de>2009-04-28 01:21:36 +0200
commitdbd33614404b65aa441c5620c3dbd560c4460c09 (patch)
treee6ea0481513f27caeda49b429b6809b77683b799 /fs
parent65351a8793c51f3787efbbcf3aa1df0ad543c127 (diff)
ubifs: BUG realpath string must be ended with NULL
If the memory used to copy the link_make is "dirty" the string wont be ended with NULL, throwing out multiple memory bugs. Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@uam.es> Acked-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'fs')
-rw-r--r--fs/ubifs/ubifs.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c
index 32f9ff8ed4d..427d84a4ddb 100644
--- a/fs/ubifs/ubifs.c
+++ b/fs/ubifs/ubifs.c
@@ -641,6 +641,7 @@ 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';
printf("%s is linked to %s!\n", filename, link_name);
ubifs_iput(inode);