1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:37:34 +00:00

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

View file

@ -466,7 +466,8 @@ KResult LocalSocket::sendfd(const FileDescription& socket_description, FileDescr
// FIXME: Figure out how we should limit this properly. // FIXME: Figure out how we should limit this properly.
if (queue.size() > 128) if (queue.size() > 128)
return EBUSY; return EBUSY;
queue.append(move(passing_description)); if (!queue.try_append(move(passing_description)))
return ENOMEM;
return KSuccess; return KSuccess;
} }