]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
ubifs: BUG realpath string must be ended with NULL
authorRicardo Ribalda Delgado <ricardo.ribalda@uam.es>
Mon, 27 Apr 2009 07:13:31 +0000 (09:13 +0200)
committerWolfgang Denk <wd@denx.de>
Mon, 27 Apr 2009 23:21:36 +0000 (01:21 +0200)
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>
fs/ubifs/ubifs.c

index 32f9ff8ed4d2c018f5ddc4662cbb4087621e1851..427d84a4ddb7a0edb0e6b50bd90fc0f8372a16a6 100644 (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);