summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorRonald Zachariah <rozachar@cisco.com>2016-04-28 07:08:34 +0200
committerTom Rini <trini@konsulko.com>2016-05-02 13:33:19 -0400
commit37f23885e4905ff500a8524328aa3084ac11cdb4 (patch)
treedeaa4d52363cce6365ffcb85bc580f551f83e6a8 /fs
parentb525556e6325aa71427c0519f36247981cd444df (diff)
downloadu-boot-imx-37f23885e4905ff500a8524328aa3084ac11cdb4.zip
u-boot-imx-37f23885e4905ff500a8524328aa3084ac11cdb4.tar.gz
u-boot-imx-37f23885e4905ff500a8524328aa3084ac11cdb4.tar.bz2
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 <rozachar@cisco.com> Signed-off-by: Stefan Roese <sr@denx.de> Reviewed-by: Stephen Warren <swarren@nvidia.com> Cc: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/ext4/ext4_common.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ext4/ext4_common.c b/fs/ext4/ext4_common.c
index 84fba76..40b798a 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 {