mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 13:19:05 +00:00
Everywhere: Make ByteBuffer::{create_*,copy}() OOM-safe
This commit is contained in:
parent
3a9f00c59b
commit
97e97bccab
Notes:
sideshowbarker
2024-07-18 04:39:40 +09:00
Author: https://github.com/alimpfard
Commit: 97e97bccab
Pull-request: https://github.com/SerenityOS/serenity/pull/9832
Reviewed-by: https://github.com/IdanHo
105 changed files with 629 additions and 290 deletions
|
@ -35,7 +35,7 @@ void TLSv12::consume(ReadonlyBytes record)
|
|||
|
||||
dbgln_if(TLS_DEBUG, "Consuming {} bytes", record.size());
|
||||
|
||||
if (!m_context.message_buffer.try_append(record.data(), record.size())) {
|
||||
if (!m_context.message_buffer.try_append(record)) {
|
||||
dbgln("Not enough space in message buffer, dropping the record");
|
||||
return;
|
||||
}
|
||||
|
@ -306,7 +306,7 @@ TLSv12::TLSv12(Core::Object* parent, Options options)
|
|||
{
|
||||
m_context.options = move(options);
|
||||
m_context.is_server = false;
|
||||
m_context.tls_buffer = ByteBuffer::create_uninitialized(0);
|
||||
m_context.tls_buffer = {};
|
||||
#ifdef SOCK_NONBLOCK
|
||||
int fd = socket(AF_INET, SOCK_STREAM | SOCK_NONBLOCK, 0);
|
||||
#else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue