Kernel: Harden LocalSocket Vector usage against OOM.

This commit is contained in:
Brian Gianforcaro 2021-04-30 01:59:55 -07:00 committed by Linus Groh
parent a9f488c55b
commit e8d6d478c4
Notes: sideshowbarker 2024-07-18 18:50:21 +09:00

View File

@ -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;
}