* [U-Boot] [PATCH v2] fs: ext4: fix symlink read function
@ 2016-04-28 5:08 Stefan Roese
2016-05-02 23:32 ` [U-Boot] [U-Boot,v2] " Tom Rini
0 siblings, 1 reply; 2+ messages in thread
From: Stefan Roese @ 2016-04-28 5:08 UTC (permalink / raw)
To: u-boot
From: Ronald Zachariah <rozachar@cisco.com>
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>
---
v2:
- Change '60' to sizeof(diro->inode.b.symlink) as suggested by Stephen
fs/ext4/ext4_common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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 {
--
2.8.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-05-02 23:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-28 5:08 [U-Boot] [PATCH v2] fs: ext4: fix symlink read function Stefan Roese
2016-05-02 23:32 ` [U-Boot] [U-Boot,v2] " Tom Rini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox