1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 23:57:34 +00:00

AK: Fix unsigned integer underflow in DuplexMemoryStream::write.

This commit is contained in:
asynts 2020-12-09 15:10:33 +01:00 committed by Andreas Kling
parent a34e023a33
commit ce15c9a04c
3 changed files with 18 additions and 1 deletions

View file

@ -289,7 +289,7 @@ public:
if ((m_write_offset + nwritten) % chunk_size == 0)
m_chunks.append(ByteBuffer::create_uninitialized(chunk_size));
nwritten += bytes.copy_trimmed_to(m_chunks.last().bytes().slice(m_write_offset % chunk_size));
nwritten += bytes.slice(nwritten).copy_trimmed_to(m_chunks.last().bytes().slice(m_write_offset % chunk_size));
}
m_write_offset += nwritten;