mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 00:07:43 +00:00
Everywhere: Use OOM-safe ByteBuffer APIs where possible
If we can easily communicate failure, let's avoid asserting and report failure instead.
This commit is contained in:
parent
6606993432
commit
3a9f00c59b
22 changed files with 135 additions and 67 deletions
|
@ -57,7 +57,10 @@ String InspectableProcess::wait_for_response()
|
|||
auto packet = m_socket->read(remaining_bytes);
|
||||
if (packet.size() == 0)
|
||||
break;
|
||||
data.append(packet.data(), packet.size());
|
||||
if (!data.try_append(packet.data(), packet.size())) {
|
||||
dbgln("Failed to append {} bytes to data buffer", packet.size());
|
||||
break;
|
||||
}
|
||||
remaining_bytes -= packet.size();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue