]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Add a check_no_tls_errors() to read_to_buf_tls
authorArturo Filastò <hellais@gmail.com>
Wed, 22 Feb 2012 08:29:16 +0000 (00:29 -0800)
committerNick Mathewson <nickm@torproject.org>
Tue, 24 Apr 2012 15:36:38 +0000 (11:36 -0400)
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)

changes/bug4528 [new file with mode: 0644]
src/or/buffers.c

diff --git a/changes/bug4528 b/changes/bug4528
new file mode 100644 (file)
index 0000000..8703d6a
--- /dev/null
@@ -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.
index d4fc44ba9f0b077248067114b140fe21a2e348a6..d60e54e87a17df21245aa9e3c737b7482e2741aa 100644 (file)
@@ -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) {