fs: ext4: fix symlink read function
PATCH v2 1/1 fs: ext4: fix symlink read function
From: Ronald Zachariah <[email protected]>
The function ext4fs_read_symlink was unable to handle a symlink which had target name of exactly 60 characters.
Signed-off-by Ronald Zachariah <[email protected]>
Signed-off-by Stefan Roese <[email protected]>
Reviewed-by Stephen Warren <[email protected]>
Cc Tom Rini <[email protected]>
---
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(-)
fs/ext4/ext4_common.c +1 -1
@@ -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 {
Signature · 1 line
2.8.1
PATCH v2 1/1 fs: ext4: fix symlink read function
Quoted 9 lines · Stefan Roese
From: Ronald Zachariah <[email protected]>
The function
ext4fs_read_symlinkwas unable to handle a symlink which had target name of exactly 60 characters.Signed-off-by Ronald Zachariah <[email protected]>Signed-off-by Stefan Roese <[email protected]>Reviewed-by Stephen Warren <[email protected]>Cc Tom Rini <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160502/ee70d77a/attachment.sig>