diff options
author | Nick Mathewson <nickm@torproject.org> | 2020-01-29 08:31:22 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2020-01-29 08:31:22 -0500 |
commit | 1f163fcbde4591bcb5764d6bbe0fea8aa559fc33 (patch) | |
tree | 509600bf52cd320f65ea723974849f7cd3f2061e /src | |
parent | 19954cffd7710ccac778aa5cf15ae1bc6a5d56fa (diff) | |
download | tor-1f163fcbde4591bcb5764d6bbe0fea8aa559fc33.tar.gz tor-1f163fcbde4591bcb5764d6bbe0fea8aa559fc33.zip |
Change BUG() messages in buf_flush_to_tls() to IF_BUG_ONCE()
We introduced these BUG() checks in b0ddaac07428a06 to prevent a
recurrence of bug 23690. But there's a report of the BUG() message
getting triggered and filling up the disk. Let's change it to
IF_BUG_ONCE().
Fixes bug 33093; bugfix on 0.3.2.2-alpha.
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/tls/buffers_tls.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/tls/buffers_tls.c b/src/lib/tls/buffers_tls.c index e92cb9163f..b570216df0 100644 --- a/src/lib/tls/buffers_tls.c +++ b/src/lib/tls/buffers_tls.c @@ -146,10 +146,10 @@ buf_flush_to_tls(buf_t *buf, tor_tls_t *tls, size_t flushlen, size_t flushed = 0; ssize_t sz; tor_assert(buf_flushlen); - if (BUG(*buf_flushlen > buf->datalen)) { + IF_BUG_ONCE(*buf_flushlen > buf->datalen) { *buf_flushlen = buf->datalen; } - if (BUG(flushlen > *buf_flushlen)) { + IF_BUG_ONCE(flushlen > *buf_flushlen) { flushlen = *buf_flushlen; } sz = (ssize_t) flushlen; |