mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-12 17:37:53 +03: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
@ -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 New Issue
Block a user