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>
This commit is contained in:
Ricardo Ribalda Delgado 2009-04-27 09:13:31 +02:00 committed by Wolfgang Denk
parent 65351a8793
commit dbd3361440
1 changed files with 1 additions and 0 deletions

View File

@ -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);