summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-10-22 11:01:50 -0400
committerNick Mathewson <nickm@torproject.org>2014-10-22 11:01:50 -0400
commit653221e807fb07ce20e70566f95c6d27c284990e (patch)
treea4728f5698a009bfb9195b3f2ab27d7ef029b42b
parent8e4daa7bb0941037b6b5585059e5570267ee6eb9 (diff)
parent7573e66b9961cdb571c3c7af688fd01912e66455 (diff)
downloadtor-653221e807fb07ce20e70566f95c6d27c284990e.tar.gz
tor-653221e807fb07ce20e70566f95c6d27c284990e.zip
Merge remote-tracking branch 'public/bug11824_v2'
-rw-r--r--changes/bug118245
-rw-r--r--src/common/torgzip.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/changes/bug11824 b/changes/bug11824
new file mode 100644
index 0000000000..1eb89ca14b
--- /dev/null
+++ b/changes/bug11824
@@ -0,0 +1,5 @@
+ o Minor bugfixes:
+ - When trying to finalize a zlib stream where we have already
+ exhausted all the input bytes and we need more bytes in the
+ output buffer, do not report the the write as successful.
+ Fixes bug 11824; bugfix on 0.1.1.23.
diff --git a/src/common/torgzip.c b/src/common/torgzip.c
index b4688bf9d8..d9c5b26675 100644
--- a/src/common/torgzip.c
+++ b/src/common/torgzip.c
@@ -511,7 +511,7 @@ tor_zlib_process(tor_zlib_state_t *state,
case Z_STREAM_END:
return TOR_ZLIB_DONE;
case Z_BUF_ERROR:
- if (state->stream.avail_in == 0)
+ if (state->stream.avail_in == 0 && !finish)
return TOR_ZLIB_OK;
return TOR_ZLIB_BUF_FULL;
case Z_OK: