diff options
author | teor <teor@torproject.org> | 2019-10-04 12:33:34 +1000 |
---|---|---|
committer | teor <teor@torproject.org> | 2019-10-04 12:33:34 +1000 |
commit | ff304f3be7d6b5753d2066a0af9772b451f7f442 (patch) | |
tree | d96b57f7d88733aba926995ff6502a198d9d722a /src/lib/tls/buffers_tls.c | |
parent | 7b9cb4c47bc9d1ca4e120af2b00a0f0747cd7b20 (diff) | |
download | tor-ff304f3be7d6b5753d2066a0af9772b451f7f442.tar.gz tor-ff304f3be7d6b5753d2066a0af9772b451f7f442.zip |
tls: Log TLS read buffer length bugs once
Rather than filling the logs with similar warnings.
Fixes bug 31939; bugfix on 0.3.0.4-rc.
Diffstat (limited to 'src/lib/tls/buffers_tls.c')
-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 c176162c35..e92cb9163f 100644 --- a/src/lib/tls/buffers_tls.c +++ b/src/lib/tls/buffers_tls.c @@ -68,9 +68,9 @@ buf_read_from_tls(buf_t *buf, tor_tls_t *tls, size_t at_most) check_no_tls_errors(); - if (BUG(buf->datalen >= INT_MAX)) + IF_BUG_ONCE(buf->datalen >= INT_MAX) return -1; - if (BUG(buf->datalen >= INT_MAX - at_most)) + IF_BUG_ONCE(buf->datalen >= INT_MAX - at_most) return -1; while (at_most > total_read) { |