diff options
Diffstat (limited to 'Userland/Utilities')
-rw-r--r-- | Userland/Utilities/pro.cpp | 3 | ||||
-rw-r--r-- | Userland/Utilities/test-crypto.cpp | 10 |
2 files changed, 9 insertions, 4 deletions
diff --git a/Userland/Utilities/pro.cpp b/Userland/Utilities/pro.cpp index 7556eb7a17..6bf653d1bc 100644 --- a/Userland/Utilities/pro.cpp +++ b/Userland/Utilities/pro.cpp @@ -122,7 +122,8 @@ private: { if (!m_condition()) { write_to_buffer:; - m_buffer.append(bytes.data(), bytes.size()); + if (!m_buffer.try_append(bytes.data(), bytes.size())) + return 0; return bytes.size(); } diff --git a/Userland/Utilities/test-crypto.cpp b/Userland/Utilities/test-crypto.cpp index 82338909c7..f096442bcc 100644 --- a/Userland/Utilities/test-crypto.cpp +++ b/Userland/Utilities/test-crypto.cpp @@ -165,8 +165,9 @@ static void tls(const char* message, size_t len) g_loop.quit(0); }; } - write.append(message, len); - write.append("\r\n", 2); + auto ok = write.try_append(message, len); + ok = ok && write.try_append("\r\n", 2); + VERIFY(ok); } static void aes_cbc(const char* message, size_t len) @@ -2037,7 +2038,10 @@ static void tls_test_client_hello() loop.quit(1); } else { // print_buffer(data.value(), 16); - contents.append(data.value().data(), data.value().size()); + if (!contents.try_append(data.value().data(), data.value().size())) { + FAIL(Allocation failed); + loop.quit(1); + } } }; tls->on_tls_finished = [&] { |