mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-24 06:48:05 +01:00
when we're doing a write split over the end of a circular
buffer, make sure our tls_get_forced_write_size doesn't make it write whatever's after the buffer. this hasn't triggered yet, but it would be rare, so let's leave it in. svn:r9107
This commit is contained in:
parent
c9c8072bd3
commit
30e4f4f6ce
1 changed files with 4 additions and 0 deletions
|
@ -694,6 +694,10 @@ flush_buf_tls(tor_tls_t *tls, buf_t *buf, size_t sz, size_t *buf_flushlen)
|
|||
|
||||
flushlen0 = sz;
|
||||
_split_range(buf, buf->cur, &flushlen0, &flushlen1);
|
||||
if (flushlen1) {
|
||||
size_t forced = tor_tls_get_forced_write_size(tls);
|
||||
tor_assert(forced <= flushlen0);
|
||||
}
|
||||
|
||||
r = flush_buf_tls_impl(tls, buf, flushlen0, buf_flushlen);
|
||||
check();
|
||||
|
|
Loading…
Add table
Reference in a new issue