diff options
author | teor <teor@torproject.org> | 2019-11-25 12:29:43 +1000 |
---|---|---|
committer | teor <teor@torproject.org> | 2019-11-25 12:29:43 +1000 |
commit | f9812ee5f7336bac9caaf57946e46cd19dfaf0be (patch) | |
tree | e0bf8c082d95b7c72c0def6f068b874f4e29d04e | |
parent | 7beaaed245e99c57a5b35c266da4ff9fa5f2b113 (diff) | |
parent | ff304f3be7d6b5753d2066a0af9772b451f7f442 (diff) | |
download | tor-f9812ee5f7336bac9caaf57946e46cd19dfaf0be.tar.gz tor-f9812ee5f7336bac9caaf57946e46cd19dfaf0be.zip |
Merge remote-tracking branch 'tor-github/pr/1394' into maint-0.3.5
-rw-r--r-- | changes/bug31939 | 3 | ||||
-rw-r--r-- | src/lib/tls/buffers_tls.c | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/changes/bug31939 b/changes/bug31939 new file mode 100644 index 0000000000..a36ea495d6 --- /dev/null +++ b/changes/bug31939 @@ -0,0 +1,3 @@ + o Minor bugfixes (tls, logging): + - 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. 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) { |