From 7132195b320b4d5cd2713eb840045f8e2e525554 Mon Sep 17 00:00:00 2001 From: Paul Fertser Date: Sat, 31 Jan 2009 17:23:30 +0000 Subject: [PATCH] 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. --- qiboot/src/fs/ext2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiboot/src/fs/ext2.c b/qiboot/src/fs/ext2.c index 21165a3..2709806 100644 --- a/qiboot/src/fs/ext2.c +++ b/qiboot/src/fs/ext2.c @@ -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 {