Skip to content
Snippets Groups Projects
Commit dbd33614 authored by Ricardo Ribalda's avatar Ricardo Ribalda Committed by Wolfgang Denk
Browse files

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: default avatarRicardo Ribalda Delgado <ricardo.ribalda@uam.es>
Acked-by: default avatarStefan Roese <sr@denx.de>
parent 65351a87
No related branches found
No related tags found
No related merge requests found
...@@ -641,6 +641,7 @@ int ubifs_load(char *filename, u32 addr, u32 size) ...@@ -641,6 +641,7 @@ int ubifs_load(char *filename, u32 addr, u32 size)
ui = ubifs_inode(inode); ui = ubifs_inode(inode);
if (((inode->i_mode & S_IFMT) == S_IFLNK) && ui->data_len) { if (((inode->i_mode & S_IFMT) == S_IFLNK) && ui->data_len) {
memcpy(link_name, ui->data, 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); printf("%s is linked to %s!\n", filename, link_name);
ubifs_iput(inode); ubifs_iput(inode);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment