Kaynağa Gözat

Add a check_no_tls_errors() to read_to_buf_tls

Fixes bug #4528 "read_to_buf_tls(): Inconsistency in code".

This check was added back in 0.1.0.3-rc, but somehow we forgot to
leave it in when we refactored read_to_buf_tls in 0.1.0.5-rc.

(patch by Arturo; commit message and changes file by nickm)
Arturo Filastò 12 yıl önce
ebeveyn
işleme
e0e4b84757
2 değiştirilmiş dosya ile 9 ekleme ve 0 silme
  1. 6 0
      changes/bug4528
  2. 3 0
      src/or/buffers.c

+ 6 - 0
changes/bug4528

@@ -0,0 +1,6 @@
+
+   o Minor bugfixes:
+     - Make sure that there are no unhandled pending TLS errors before
+       reading from a TLS stream. We had checks in 0.1.0.3-rc, but
+       lost them in 0.1.0.5-rc when we refactored read_to_buf_tls().
+       Bugfix on 0.1.0.5-rc; fixes bug 4528.

+ 3 - 0
src/or/buffers.c

@@ -744,6 +744,9 @@ read_to_buf_tls(tor_tls_t *tls, size_t at_most, buf_t *buf)
 {
   int r = 0;
   size_t total_read = 0;
+
+  check_no_tls_errors();
+
   check();
 
   while (at_most > total_read) {