mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
Kernel: Harden LocalSocket Vector usage against OOM.
This commit is contained in:
parent
a9f488c55b
commit
e8d6d478c4
Notes:
sideshowbarker
2024-07-18 18:50:21 +09:00
Author: https://github.com/bgianfo Commit: https://github.com/SerenityOS/serenity/commit/e8d6d478c45 Pull-request: https://github.com/SerenityOS/serenity/pull/6756 Reviewed-by: https://github.com/awesomekling
1 changed files with 2 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue