提交 37f23885 编写于 作者: R Ronald Zachariah 提交者: Tom Rini

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: NRonald Zachariah <rozachar@cisco.com>
Signed-off-by: NStefan Roese <sr@denx.de>
Reviewed-by: NStephen Warren <swarren@nvidia.com>
Cc: Tom Rini <trini@konsulko.com>
上级 b525556e
......@@ -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 {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册