mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 18:18:12 +00:00
parent
e590c53a1d
commit
a316ca0e0d
1 changed files with 4 additions and 0 deletions
|
@ -27,6 +27,7 @@
|
|||
#include <Kernel/FileSystem/TmpFS.h>
|
||||
#include <Kernel/Process.h>
|
||||
#include <Kernel/Thread.h>
|
||||
#include <LibC/limits.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
|
@ -297,6 +298,9 @@ KResult TmpFSInode::add_child(Inode& child, const StringView& name, mode_t)
|
|||
ASSERT(is_directory());
|
||||
ASSERT(child.fsid() == fsid());
|
||||
|
||||
if (name.length() > NAME_MAX)
|
||||
return KResult(-ENAMETOOLONG);
|
||||
|
||||
m_children.set(name, { name, static_cast<TmpFSInode&>(child) });
|
||||
did_add_child(child.identifier());
|
||||
return KSuccess;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue