1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 18:54:57 +00:00

Ext2FileSystem::readInode() should return an empty buffer for 0-length files.

This commit is contained in:
Andreas Kling 2018-10-13 00:49:52 +02:00
parent c2d42710bb
commit 750b27cb07
2 changed files with 4 additions and 0 deletions

View file

@ -260,6 +260,9 @@ ByteBuffer Ext2FileSystem::readInode(InodeIdentifier inode) const
return nullptr;
}
if (e2inode->i_size == 0)
return ByteBuffer::createEmpty();
// Symbolic links shorter than 60 characters are store inline inside the i_block array.
// This avoids wasting an entire block on short links. (Most links are short.)
static const unsigned maxInlineSymlinkLength = 60;