From: Ronald Zachariah Date: Thu, 28 Apr 2016 05:08:34 +0000 (+0200) Subject: fs: ext4: fix symlink read function X-Git-Tag: v2016.05~41 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=37f23885e4905ff500a8524328aa3084ac11cdb4;p=oweals%2Fu-boot.git fs: ext4: fix symlink read function The function ext4fs_read_symlink was unable to handle a symlink which had target name of exactly 60 characters. Signed-off-by: Ronald Zachariah Signed-off-by: Stefan Roese Reviewed-by: Stephen Warren Cc: Tom Rini --- diff --git a/fs/ext4/ext4_common.c b/fs/ext4/ext4_common.c index 84fba767c1..40b798a43f 100644 --- a/fs/ext4/ext4_common.c +++ b/fs/ext4/ext4_common.c @@ -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 {