mirror of
https://github.com/RGBCube/serenity
synced 2025-05-15 01:54:57 +00:00
Kernel: Return early in create_inode if name is too long
This commit is contained in:
parent
cfa5e6efe9
commit
d79194d87f
1 changed files with 3 additions and 0 deletions
|
@ -1445,6 +1445,9 @@ KResultOr<NonnullRefPtr<Inode>> Ext2FS::create_inode(InodeIdentifier parent_id,
|
|||
if (static_cast<const Ext2FSInode&>(*parent_inode).m_raw_inode.i_links_count == 0)
|
||||
return KResult(-ENOENT);
|
||||
|
||||
if (name.length() > EXT2_NAME_LEN)
|
||||
return KResult(-ENAMETOOLONG);
|
||||
|
||||
#ifdef EXT2_DEBUG
|
||||
dbg() << "Ext2FS: Adding inode '" << name << "' (mode " << String::format("%o", mode) << ") to parent directory " << parent_inode->identifier();
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue