diff options
author | Nick Mathewson <nickm@torproject.org> | 2020-01-30 09:58:23 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2020-01-30 09:58:23 -0500 |
commit | af76b9dcc6dd24d2dac2c8710386af86f0c50822 (patch) | |
tree | 08b0e06e31f24265dcc7241f0b6f200b4b9909ff | |
parent | 9ea0c0bfcdbed7734f49f20a032da7f978b48ad4 (diff) | |
parent | 2985a6018f1123b8843023f09d004f477f59a009 (diff) | |
download | tor-af76b9dcc6dd24d2dac2c8710386af86f0c50822.tar.gz tor-af76b9dcc6dd24d2dac2c8710386af86f0c50822.zip |
Merge branch 'bug32673_035'
-rw-r--r-- | changes/bug32673 | 5 | ||||
-rw-r--r-- | src/lib/tls/buffers_tls.c | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/changes/bug32673 b/changes/bug32673 new file mode 100644 index 0000000000..32f02c6393 --- /dev/null +++ b/changes/bug32673 @@ -0,0 +1,5 @@ + o Minor bugfixes (TLS bug handling): + - When encountering a bug in buf_read_freom_tls(), return a + "MISC" error code rather than "WANTWRITE". This change might + help avoid some CPU-wasting loops if the bug is ever triggered. + Bug reported by opara. Fixes bug 32673; bugfix on 0.3.0.4-alpha. diff --git a/src/lib/tls/buffers_tls.c b/src/lib/tls/buffers_tls.c index 79a908e2cc..87055744a7 100644 --- a/src/lib/tls/buffers_tls.c +++ b/src/lib/tls/buffers_tls.c @@ -69,9 +69,9 @@ buf_read_from_tls(buf_t *buf, tor_tls_t *tls, size_t at_most) check_no_tls_errors(); IF_BUG_ONCE(buf->datalen >= INT_MAX) - return -1; + return TOR_TLS_ERROR_MISC; IF_BUG_ONCE(buf->datalen >= INT_MAX - at_most) - return -1; + return TOR_TLS_ERROR_MISC; while (at_most > total_read) { size_t readlen = at_most - total_read; |