mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-25 09:04:53 +00:00
Kernel: Harden Socket Vector usage against OOM
This commit is contained in:
committed by
Linus Groh
parent
e8d6d478c4
commit
f0568bff9b
@@ -72,7 +72,8 @@ KResult Socket::queue_connection_from(NonnullRefPtr<Socket> peer)
|
||||
Locker locker(m_lock);
|
||||
if (m_pending.size() >= m_backlog)
|
||||
return ECONNREFUSED;
|
||||
m_pending.append(peer);
|
||||
if (!m_pending.try_append(peer))
|
||||
return ENOMEM;
|
||||
evaluate_block_conditions();
|
||||
return KSuccess;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user