1
0
mirror of git://projects.qi-hardware.com/xburst-tools.git synced 2024-12-23 16:24:16 +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:
Paul Fertser 2009-01-31 17:23:30 +00:00 committed by Andy Green
parent 4a8cabd5a9
commit 7132195b32

View File

@ -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 {