mirror of
git://projects.qi-hardware.com/xburst-tools.git
synced 2024-11-26 01:59:44 +02:00
Fix handling of 60 bytes long symlinks
On ext2 the symlink can be stored in inode itself if it's not larger than 60 bytes. If the symlink path is exactly 60 bytes, then one more byte is needed to store terminating NULL, therefore the path is placed in a separate block.
This commit is contained in:
parent
4a8cabd5a9
commit
7132195b32
@ -653,7 +653,7 @@ static char *ext2fs_read_symlink(ext2fs_node_t node) {
|
||||
/* If the filesize of the symlink is bigger than
|
||||
60 the symlink is stored in a separate block,
|
||||
otherwise it is stored in the inode. */
|
||||
if (__le32_to_cpu(diro->inode.size) <= 60) {
|
||||
if (__le32_to_cpu(diro->inode.size) < 60) {
|
||||
strncpy(symlink, diro->inode.b.symlink,
|
||||
__le32_to_cpu(diro->inode.size));
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user