]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
fs: ext4: fix symlink read function
authorRonald Zachariah <rozachar@cisco.com>
Thu, 28 Apr 2016 05:08:34 +0000 (07:08 +0200)
committerTom Rini <trini@konsulko.com>
Mon, 2 May 2016 17:33:19 +0000 (13:33 -0400)
The function ext4fs_read_symlink was unable to handle a symlink
which had target name of exactly 60 characters.

Signed-off-by: Ronald Zachariah <rozachar@cisco.com>
Signed-off-by: Stefan Roese <sr@denx.de>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Cc: Tom Rini <trini@konsulko.com>
fs/ext4/ext4_common.c

index 84fba767c1ad71e3a5df53c8bbd0696e2f690f81..40b798a43fa62e0237b3e70162efcaefc76a0f61 100644 (file)
@@ -2040,7 +2040,7 @@ static char *ext4fs_read_symlink(struct ext2fs_node *node)
        if (!symlink)
                return 0;
 
-       if (__le32_to_cpu(diro->inode.size) <= 60) {
+       if (__le32_to_cpu(diro->inode.size) < sizeof(diro->inode.b.symlink)) {
                strncpy(symlink, diro->inode.b.symlink,
                         __le32_to_cpu(diro->inode.size));
        } else {