mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 06:48:49 +00:00
Kernel: Return early in create_inode if name is too long
This commit is contained in:
parent
cfa5e6efe9
commit
d79194d87f
Notes:
sideshowbarker
2024-07-19 02:08:28 +09:00
Author: https://github.com/Lubrsi
Commit: d79194d87f
Pull-request: https://github.com/SerenityOS/serenity/pull/3635
Issue: https://github.com/SerenityOS/serenity/issues/3634
Reviewed-by: https://github.com/awesomekling
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