summaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
authorRonald Zachariah <rozachar@cisco.com>2016-07-06 22:58:44 +0300
committerSascha Hauer <s.hauer@pengutronix.de>2016-07-07 09:18:28 +0200
commit3dc604d636c73c3526708140fd5d018ecc34346e (patch)
treef9c432df97c63572c6a2043a642cbd9072eaac40 /fs/ext4
parent90326eba5ac9787405abf4d323c8d82d1cda6d38 (diff)
downloadbarebox-3dc604d636c73c3526708140fd5d018ecc34346e.tar.gz
barebox-3dc604d636c73c3526708140fd5d018ecc34346e.tar.xz
fs: ext4: fix symlink read function
From U-Boot commit: | commit 37f23885e4905ff500a8524328aa3084ac11cdb4 | Author: Ronald Zachariah <rozachar@cisco.com> | Date: Thu Apr 28 07:08:34 2016 +0200 | | 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> Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'fs/ext4')
-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 1ecbb8dfb7..6c4083eae9 100644
--- a/fs/ext4/ext4_common.c
+++ b/fs/ext4/ext4_common.c
@@ -377,7 +377,7 @@ 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 {