]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
tls: Log TLS read buffer length bugs once
authorteor <teor@torproject.org>
Fri, 4 Oct 2019 02:33:34 +0000 (12:33 +1000)
committerteor <teor@torproject.org>
Fri, 4 Oct 2019 02:33:34 +0000 (12:33 +1000)
Rather than filling the logs with similar warnings.

Fixes bug 31939; bugfix on 0.3.0.4-rc.

changes/bug31939 [new file with mode: 0644]
src/lib/tls/buffers_tls.c

diff --git a/changes/bug31939 b/changes/bug31939
new file mode 100644 (file)
index 0000000..a36ea49
--- /dev/null
@@ -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.
index c176162c3523bb5d5c566b0f5d5d45d4855e25a2..e92cb9163fa0f86ea5f3b54aa1c3f39725bdd717 100644 (file)
@@ -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) {