Skip to content

Commit 55ecd13

Browse files
committed
tcp: Assert on size to avoid overshooting buffer
1 parent d939be1 commit 55ecd13

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/net/tcp/write_queue.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ void Write_queue::advance(size_t bytes)
3131
auto& buf = nxt();
3232

3333
offset_ += bytes;
34+
assert(offset_ <= buf->size());
3435

3536
debug2("<WriteQueue> Advance: bytes=%u off=%u rem=%u\n",
3637
bytes, offset_, (buf->size() - offset_));

0 commit comments

Comments
 (0)