mirror of
https://github.com/RGBCube/serenity
synced 2025-05-16 19:05:08 +00:00
Ext2FS: Don't copy more than sizeof(ext2_inode) bytes of raw inode data.
Some file systems have inodes larger than sizeof(ext2_inode) so this would stomp all over unrelated data.
This commit is contained in:
parent
a7a456002e
commit
d218686c0a
1 changed files with 1 additions and 1 deletions
|
@ -424,7 +424,7 @@ RetainPtr<Inode> Ext2FS::get_inode(InodeIdentifier inode) const
|
|||
if (it != m_inode_cache.end())
|
||||
return (*it).value;
|
||||
auto new_inode = adopt(*new Ext2FSInode(const_cast<Ext2FS&>(*this), inode.index()));
|
||||
memcpy(&new_inode->m_raw_inode, reinterpret_cast<ext2_inode*>(block.offset_pointer(offset)), inode_size());
|
||||
memcpy(&new_inode->m_raw_inode, reinterpret_cast<ext2_inode*>(block.offset_pointer(offset)), sizeof(ext2_inode));
|
||||
m_inode_cache.set(inode.index(), new_inode.copy_ref());
|
||||
return new_inode;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue