Skip to content

Commit

Permalink
Kernel: Harden LocalSocket Vector usage against OOM.
Browse files Browse the repository at this point in the history
  • Loading branch information
bgianfo authored and linusg committed May 1, 2021
1 parent a9f488c commit e8d6d47
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Kernel/Net/LocalSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,8 @@ KResult LocalSocket::sendfd(const FileDescription& socket_description, FileDescr
// FIXME: Figure out how we should limit this properly.
if (queue.size() > 128)
return EBUSY;
queue.append(move(passing_description));
if (!queue.try_append(move(passing_description)))
return ENOMEM;
return KSuccess;
}

Expand Down

0 comments on commit e8d6d47

Please sign in to comment.