summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 4328c63c8b..778cbe9169 100644
--- a/src/common/torgzip.c
+++ b/src/common/torgzip.c
@@ -480,7 +480,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: